# 2D Array Help

## Recommended Posts

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

Where do your numbers originate?  You can use nested For loops, an Addition node and a random number generator.

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??

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.

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.

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

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

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

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

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.

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.

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?

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?

Edited by ShaunR

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.

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!!

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
• ### Similar Content

• #### LV DLL creates mysterious DoubleArray class

By torekp,

• 4 replies
• 3,969 views
• #### Extract EXCEL sheet contents into 2D array.

By Grey,

• 4 replies
• 19,849 views
×