LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify one element of a 2D array?

Solved!
Go to solution

I have been searching the forums for a similar problem but cannot find anything. Apologies if this seems trivial but I am not a LabVIEW specialist and my project encompasses a lot of disciplines so sometimes when I am working on LabVIEW related tasks I need a refresher now and then.

 

Basically I am trying to modify - not replace - one element in a 2D array. So for example, if I have the 2D array:

 

A

1 2 3 4

 

B

1 2 3 4

 

C

1 2 3 4

 

I am trying to divide element 3 by 1000.

 

I suspect that, like so much of LabVIEW, this would be very easy to someone who already knows how to do it...

 

0 Kudos
Message 1 of 3
(4,045 Views)
Solution
Accepted by topic author Sidleg

Index out the element you want to modify (using index array), perform the modification, put back at right index using replace array element.

 

If you are worried about performance, use the in-place element.

http://www.ni.com/white-paper/6211/en/



CLA
www.dvel.se
Message 2 of 3
(4,033 Views)

You should go to array pallete, select index array ( you will automaticaly get two index, so you place number of your element. It will outout that number , you will do math, and again, go to array palete, and select inset into array.

 

And modification is replace. this will give you something like this array[a][b]=array[a][b]/1000;

Message 3 of 3
(4,029 Views)