LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete columns from a array

Solved!
Go to solution

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

0 Kudos
Message 1 of 8
(4,242 Views)
Solution
Accepted by topic author Sjefsgjogleren

You can look at it from two different angles:

 

  • You can delete the extra columns
  • you can keep only the fist three columns

 

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.)

Message 2 of 8
(4,240 Views)

array subset then process the data? I believe that will return 3 columns from a 2d array check the context help

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 8
(4,237 Views)

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?Smiley Embarassed

0 Kudos
Message 4 of 8
(4,223 Views)

@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. 😉

0 Kudos
Message 5 of 8
(4,222 Views)

@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?Smiley Embarassed


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.

Message 6 of 8
(4,218 Views)

@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?Smiley Embarassed


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

-----

The best solution is the one you find it by yourself
Message 7 of 8
(4,213 Views)

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

0 Kudos
Message 8 of 8
(4,213 Views)