LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

avoid indexing inside the loop

hi ..
Can i improve the code in attached vi? can i reduce the indexing inside the loop?
thank you,
Ranjit
0 Kudos
Message 1 of 5
(2,773 Views)

You can initialize the array before the for loop and inside use the replace element function.

At the end you can resize your array to the final number of elements.

How big is your input array?

If it is small, you should not have any problems,

0 Kudos
Message 2 of 5
(2,767 Views)

You can initialize the array before the for loop and inside use the replace element function.

At the end you can resize your array to the final number of elements.

How big is your input array?

If it is small, you should not have any problems, as it is



Message Edited by Pnt on 07-18-2008 08:25 AM
0 Kudos
Message 3 of 5
(2,767 Views)

Unfortunately I do not have LV installed on this PC therefore I could not look at your code.

However, if you are using a loop only to deal with an array, please note that many functions (VI) are polymorphic and will deal with arrays without the use of a loop.

R

0 Kudos
Message 4 of 5
(2,736 Views)
What are you trying to do?
0 Kudos
Message 5 of 5
(2,716 Views)