03-20-2012 09:30 AM
Hello
I have an 2D array that consists of 12 columns. I just want to use the first three columns inside LabView. What is the quickest way of extracting the data from these three columns?
Greetings
Kristoffer
Solved! Go to Solution.
03-20-2012 09:33 AM - edited 03-20-2012 09:43 AM
You can look at it from two different angles:
Easiest would be to use "array subset" and select the first three columns. See picture.
(This assumes that you want the three columns as a 2D array. If you want them as three 1D arrays, you would use "index array" resized to three outputs.)
03-20-2012 09:34 AM
array subset then process the data? I believe that will return 3 columns from a 2d array check the context help
03-20-2012 09:48 AM
Thank you, this seems to be the way of doing it. May I just ask how i can define the columns instead of the rows?
03-20-2012 09:48 AM
@Sjefsgjogleren wrote:
What is the quickest way of extracting the data from these three columns?
Please define what you mean by "extracting data from columns". This can be interpreted in many different ways (The above solutions extraced the first three columns, possibly not quite the same).
You could for example transpose the array and autoindex at a FOR loop with a "3" wired to N and it will process the first three columns, one per iteration.
Please clarify what you need to do, exactly. 😉
03-20-2012 09:50 AM - edited 03-20-2012 09:52 AM
@Sjefsgjogleren wrote:
Thank you, this seems to be the way of doing it. May I just ask how i can define the columns instead of the rows?
Look at my picture above. Wire the number of columns to the lowest "size" input and leave the rest of the lower inputs of "array subset" unwired.
03-20-2012 09:52 AM
@Sjefsgjogleren wrote:
Thank you, this seems to be the way of doing it. May I just ask how i can define the columns instead of the rows?
It depends where you are giving the length value. 1st index and length corresponds to row and the 2nd index and length corresponds to coloumn.
Good luck
03-20-2012 09:52 AM
I mean just the way you showed in the picture above;) I got it all right now, thanks a lot for the help!:)
Greetings
Kristoffer