12-07-2011 08:37 AM
Hi,
I have 3D array (4x6x4) with the data. I need to create 1D array with the data at a given row and column for all the pages. I prepared a picture to better explain it. The red arrow goes through the pages 0,1,2,3, and points to the data contained in row 3, and column 0 creating 1D array with 4 elements. I need to “scan” all the rows and columns to create 6x4=24 such 1D arrays. Is there simple solution to this problem? I am running LabVIEW 8.6.
Thanks in advance!
Solved! Go to Solution.
12-07-2011 09:14 AM
12-07-2011 09:32 AM - edited 12-07-2011 09:33 AM
Thanks .:aCe:. it is very close to the solution. The only problem is I need to “scan” through all the rows and columns automatically in a loop.
How can I accomplish this?
12-07-2011 09:43 AM
.:aCe:. is on the right track. (but begging to make the Rube Goldberg thread) the Resize Array primitave solves for the general case and can reuse the array buffer saving some RAM to boot
12-07-2011 09:55 AM - edited 12-07-2011 09:56 AM
Good one Jeff. I did not read the last lines! Well not properly anyway, thats my excuse!
Whats your excuse of not saving it in version 8.6?
12-07-2011 10:39 AM
Thanks Jeff, it works!
12-07-2011 11:27 AM
@.:aCe:. wrote:
Good one Jeff. I did not read the last lines! Well not properly anyway, thats my excuse!
Whats your excuse of not saving it in version 8.6?
Since the "code" needed is a primitive and some wires I assumed the OP had it in 8.6
12-07-2011 11:39 AM - edited 12-07-2011 11:41 AM
I think Jeff meant to say "reshape array". It will give you a 2D array that may or may not be exactly what you want, because you specified you want 24 1D arrays. Who knows? 😉
To generically get a single vertical column, you would use "index array" (see image middle, top is equivalent code by ace).
To scan over all vertical columns, you would place it in a stack of 2 FOR loops and iterate over the xy positions.