Jump to content

2D Array Help


Recommended Posts

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.

Link to comment

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

post-54183-0-50044900-1447272486.jpg

Untitled 4.vi

Link to comment

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.

 

post-6627-0-08768400-1447273152.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

  • Like 2
Link to comment

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.

 

attachicon.gifExample_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

Link to comment

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.

 

post-15232-0-04719000-1447274589.png

Link to comment

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

  • Like 1
Link to comment

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.

Link to comment

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

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.