Beamer397 Posted November 11, 2015 Report Share Posted November 11, 2015 Im trying to do this problem that has a 2D array with 12 rows and 6 columns. It wants the first row to only display numbers 0-1, the second row 1-2, third 2-3, and so on to the final row. Any suggestions on how i can do this? not sure where to even start Quote Link to comment
jcarmody Posted November 11, 2015 Report Share Posted November 11, 2015 Where do your numbers originate? You can use nested For loops, an Addition node and a random number generator. 1 Quote Link to comment
Beamer397 Posted November 11, 2015 Author Report Share Posted November 11, 2015 Where do your numbers originate? You can use nested For loops, an Addition node and a random number generator. The numbers i assume are random generated, for the addition node what am i adding? The random number generator and a constant?? Quote Link to comment
jcarmody Posted November 11, 2015 Report Share Posted November 11, 2015 You'll add the random number and a different constant for each row you make. The random number generated will be between 0 and 1, so, for the first row you'll need to add zero; add one for the second row, etc. Try making nested loops and see what you get. Do you understand how rows & columns of a 2D array are generated in this fashion? Are you familiar with the For loop's "i" and "N" terminals? Show me your code, Wireworker, and I'll show you mine. Quote Link to comment
hooovahh Posted November 11, 2015 Report Share Posted November 11, 2015 Also did you take a picture of a piece of paper, of a printed front panel, of a VI? Is this an assignment? Not that we won't help with assignments but we won't just do the work for you. Quote Link to comment
Beamer397 Posted November 11, 2015 Author Report Share Posted November 11, 2015 i tried making each row with the for loop to get the +1 succession for each row but it just gave an error Also did you take a picture of a piece of paper, of a printed front panel, of a VI? Is this an assignment? Not that we won't help with assignments but we won't just do the work for you. its an assignment but i just had zero clue where to even begin on it. the only instruction was whats on the paper Untitled 4.vi Quote Link to comment
hooovahh Posted November 11, 2015 Report Share Posted November 11, 2015 You made a 12 dimensional array. That is not what you want. Rarely do you need more than 2, this problem really only needs two, rows and columns. You have Rows, Columns, Pages, Books, Shelves, Bookshelves, Aisles, Libraries, Towns, States, Countries, and Planets. There are many ways to go about doing this. They will all involve some type of sorting mechanize, Maybe calling the coerce in range for the 12 different ranges, then using the conditional concatenating to build them into the rows. Here is a quick example on getting data in a range. This is a snippet and can be brought into LabVIEW as executable code. Also here is some free online training to explain the basics of LabVIEW, but I assume that's why you are taking the course. Links at the bottom. https://decibel.ni.com/content/docs/DOC-40451 2 Quote Link to comment
Beamer397 Posted November 11, 2015 Author Report Share Posted November 11, 2015 You made a 12 dimensional array. That is not what you want. Rarely do you need more than 2, this problem really only needs two, rows and columns. You have Rows, Columns, Pages, Books, Shelves, Bookshelves, Aisles, Libraries, Towns, States, Countries, and Planets. There are many ways to go about doing this. They will all involve some type of sorting mechanize, Maybe calling the coerce in range for the 12 different ranges, then using the conditional concatenating to build them into the rows. Here is a quick example on getting data in a range. This is a snippet and can be brought into LabVIEW as executable code. Example_VI_BD.png Also here is some free online training to explain the basics of LabVIEW, but I assume that's why you are taking the course. Links at the bottom. https://decibel.ni.com/content/docs/DOC-40451 i tried it with 2D array and it told me it wouldn't allow it because it wasn't 12 so i made the array 12 Quote Link to comment
ShaunR Posted November 11, 2015 Report Share Posted November 11, 2015 They will all involve some type of sorting mechanize, Maybe calling the coerce in range for the 12 different ranges, We can't see the real question so it may just be a trivial task to generate the numbers - which doesn't require binning (sorting or range checking.) The OP needs his LabVIEW eureka moment so non trivial solutions not directly addressing the question will just be confusing. Quote Link to comment
hooovahh Posted November 11, 2015 Report Share Posted November 11, 2015 We can't see the real question so it may just be a trivial task to generate the numbers - which doesn't require binning Yeah reading it again I suspect this is really all the assignment is. Quote Link to comment
ThomasGutzler Posted November 11, 2015 Report Share Posted November 11, 2015 You have Rows, Columns, Pages, Books, Shelves, Bookshelves, Aisles, Libraries, Towns, States, Countries, and Planets. Wow, where do those come from? My LabVIEW calls your Books vol and the rest is just dimX Or did you just make that up And what comes after Planets? Solar systems? Quandrants? Universes? How much further can we go? 1 Quote Link to comment
ShaunR Posted November 11, 2015 Report Share Posted November 11, 2015 (edited) Wow, where do those come from? My LabVIEW calls your Books vol and the rest is just dimX Or did you just make that up And what comes after Planets? Solar systems? Quandrants? Universes? How much further can we go? Turtles and elephants. Edited November 12, 2015 by ShaunR 2 Quote Link to comment
hooovahh Posted November 12, 2015 Report Share Posted November 12, 2015 Wow, where do those come from? My LabVIEW calls your Books vol and the rest is just dimX Yeah I made them up, but I've often thought about what you could name higher level dimensions like this. It is hard to conceptualize dimensions this large, and I think putting in these terms makes it easier to describe to people. Go to Library 4, go to Aisle 1, get Bookshelf 3 and the first shelf on it, grab the second book, turn to page 4, and you'll find the 2D array of data you want. Quote Link to comment
CraigC Posted November 13, 2015 Report Share Posted November 13, 2015 You made a 12 dimensional array. That is not what you want. Rarely do you need more than 2, this problem really only needs two, rows and columns. You have Rows, Columns, Pages, Books, Shelves, Bookshelves, Aisles, Libraries, Towns, States, Countries, and Planets. This is probably the most concise, easy to understand conceptualisation of multi-dimensioned arrays that I have ever seen!! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.