LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elements from two FOR loop

Hi Nghtcrwlr,

activate autoindexing of your loop outputs. You will get an 3,4,... dimension array. If you want only a 2x2 array you can then use the Reshape Array function.

 

Hope it helps.
Mike

Message 11 of 16
(836 Views)

Hello Mike

As mentioned by Nobert, the 4 values are taken once and then another 4 values comes in the next iteration. so only final 4 values are obtained even if we auto index the for loops.

 

Thanks

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 12 of 16
(831 Views)
You really have a fundamental misunderstanding here. Your code in the false statement creates a new array every time the case is called. You have to use a shift register and keep operating on a single array. The false case would just past the shift register through. Have you looked at any of the shipping examples? There's a basic one called Separate Array Values that demonstrates a shift register.
Message 13 of 16
(830 Views)

Hello Dennis

 

But using a sgift register just gives nothing in the array. How come that possible? WHen i run the VI i can see all the values (4 values each time) its not stored anywhere.After each loop iteration new values are obtained. How is it possibel to store all values ?

 

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 14 of 16
(805 Views)
If you get nothing in the array with a shift register, you are doing it incorrectly. In the true case, you use the Build Array to add a new element. In the false case, you wire the shift register straigh through. Look again at the shipping example I mentioned and if you still have problems, post your modified VI.
Message 15 of 16
(800 Views)

Hello dennis

 

Actually what i wanted was to get back the values used for interpolation. I mean .. i am havin a 2D array of values and I interpolate some of these values to get , say 8 new values. Now from this 8 new values i take 3 and need to find back the original values in the 2D array.

 

SO i think the way i was doin was wrong. DO you have any idea how to get back those original values?

 

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 16 of 16
(763 Views)