How do you create a 2-d array%3F

Advertisement
How do you create and write a 2-d array??  I have two operations in the same WHILE loop.  Each execution of the loop should generate a new  pair of values.  
However, the BUILD ARRAY function only outputs a 1-d array to the WRITE TO SPREADSHEET FILE.vi. 
Perhaps, more broadly, how does one put data into a 2-d array as it is collected?  I think I am building two arrays simultaneously below, but, what I really want is to build a single 2-d array.  Is this how you would do it?  It looks clumsy connecting sequential BUILD ARRAY's together.  Is this creating a 2-d array that I can search later by index and return the paired data? 
Lastly, why does my front panel indicator only show data in the first column??  How do I make it display the data as it is collected across the rows?
Thanks,
Dave
Solved!
Go to Solution.
Attachments:
forum dec 12_2012 build 2d array.vi ‏13 KB
Advertisement

Replay

dav2010 wrote:
Sorry, very simple minded here...how do pairs go as a 1-d array?  I thought that (x,y) data must be a 2-d array...a column of "x's" and a column of "y's"?  Wouldn't a 1-d array just be all x's?  I admit I'm pretty new to understanding arrays.
" build your 1D array from both scalars"  -->  how do you do this??  I cannot find a "convert to scalar" on the pallette.
Also, here is the vi saved down to 2009, I think.
Dave
Here's a simpler way, just write out your X and Y as a 1D array each iteration. The Write will append your data as a column of X's and a column of Y's:
or generate all your values and then write once:
(fix the broken wire).
“A child of five could understand this. Send someone to fetch a child of five.”
― Groucho Marx