02-26-2014 02:37 PM
Hello all!
I have two arrays containing values defined by me. Each value of respective column and row index shall be used in a formula to calculate the new value for the respective column and row, to build a new array for further use. This shall be done several times during a simulation with variable function parameters.
I am aware that I should probably use a for loop for this calculation, but I am curious to how I should build such a procedure.
Any ideas?
02-26-2014 07:38 PM - last edited on 01-21-2025 11:33 AM by Content Cleaner
Hi Euler123,
Let's say that you have an array of fix size and with values in it. Then you'll need to use auto indexing at the beginning of each for loop input tunnel (usually it is by default for for loops) as shown below:
In the first iteration of the other for loop, it will take the first row values [1, 2, 3] and pass it to the inner for loop (unless you want to extract the values for each column, transpose that 2D array before connecting it to the outer for loop). In the inner for loop, it will execute 3 times and each iteration it will extract each element from the array obtained from the outer for loop.
To build the new array, it's just the opposite. Pass the element out from the for loop and instead of getting a last value tunnel, you'll get an auto indexing tunnel (default for for loops).
Anyways, you'll need to get some basic understanding on LabVIEW first. Here's some tutorials to aid you on understanding For Loops.
http://www.youtube.com/watch?v=ziOnPNJgeVg
Here's some additional notes which might help you:
https://www.ni.com/docs/en-US/bundle/labview/page/processing-individual-elements-in-an-array-or-a-co...
Play around with For Loops and use something to slow the execution down like Highlight Execution which allows you to see what is going on. Else, take up some LabVIEW courses 😉
Warmest regards,
Lennard.C
02-27-2014 05:10 PM
Thank you