LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Handling in Formula Node

I have attached a simple VI wherein I want to take an input array, look at its size and use the size of the input array as the size of the output array. The output array needs to be declared. I want to be able to use the size of the input array "N" as the size of the output array too. The size of the input array changes dynamically based on my simulation needs. I dont want to modify the size of the array in the declaration every time I change the array size in simulation.

 

I have tried using b[N] instead of b[10] in the formula node. However LV does not seem to accept this and gives me a syntax error. 

0 Kudos
Message 1 of 4
(4,148 Views)

Sometimes its easier to just use LabVIEW.

aa.png

bb.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 4
(4,144 Views)

Jeff,

 

Thanks for the reply. I am aware of this method. However I require to use complicated formulas such as 

0.02 * (((x1 - 😎 ^ 2 + (x2 - 6) ^ 2) + 15 * Abs((x1 - 2) * (x2 - 4)) - 400 * Exp(-((x1 - 9) ^ 2 + (x2 - 9) ^ 2))).

 

This is the reason I want to use a formula Node. 

 

Thanks,

AG

 

0 Kudos
Message 3 of 4
(4,136 Views)

@AGovi wrote:

 However I require to use complicated formulas such as 


If a simple formula is easier in G, a complicated formula will also be easier in G.

 

Actually, it will scale better.  Since graphical code is 2D, doubling the code will make it only 1.4x (sqrt2) larger in each dimension, while the formula will double in lenght. 😄

0 Kudos
Message 4 of 4
(4,107 Views)