LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to build 2 dimension array by extracting the data from original 3 dimension array?

Dear all
My question seems a little complex.
1. Upload two text files: chan 1.txt and input 1.txt,
   In chan 1.txt, only one column data from channel 1,
   and In input 1.txt, there are two columns data from channel 2 and channel 3.
   Then,it can be seen in the indicator: cd,there is a 3 dimension array,
   in 1st page,there is the data form channel 1,
   in the second page, there are the data from channel 2 and 3.
  
2. By selecting the names of the files, we can get one dmesion array in "channel
   selection",
   the value 0 means chan 1.txt,which is in the 1st page in channel data(channel 1),
   the value 1 corresponds to,input 1.txt,which is in the 2nd page in channel data
   (channel 2 and channel 3).
  
3. My task: to build 2 dimension array like [channel 1, channel 2, channel 3] by selet
   the name of the files.
 
4. Simply saying, my question is how to extract the data form different pages in 3-dimension
   data array and build a new 2 dimension array at the same time.
   
Download All
0 Kudos
Message 1 of 5
(2,647 Views)
To get a 2D subset of a 3D array, simply use "index array" and only wire one of the three indices. Just try it!
0 Kudos
Message 2 of 5
(2,639 Views)

My requirement is a little complex

To build the array only by selecting the name of the files.Smiley Sad

0 Kudos
Message 3 of 5
(2,635 Views)
Sounds like you understand how to read the data, not exactly sure, but have a look at example in LV called: "How to Replace Array Elements.vi" to get ideas of inserting data into an array. See under Help >> find examples >> array
Message 4 of 5
(2,631 Views)

Your mistake is in autoindexing the result of the Read From Spreadsheet into the 3D array. Instead, use a shift register and Build array to append the results of each read to the prior one. If you transpose the Read From Spreadsheet result, each new file will be added as new rows. Then when all have been read, do another transpose to get them back into columns.

Message Edited by Dennis Knutson on 05-31-2006 12:51 PM

0 Kudos
Message 5 of 5
(2,621 Views)