06-12-2017 01:28 PM
Hello Fellow Labview-ers...
May someone please help me figure arrays out?
My problem:
I have a for loop, and I want to insert the output of it (which is a double) to an array each time the for loop executes. But I want to see in the array all of the previous elements, not just the current one.
Can someone help me with this, or should I be using a matrix? And how?
Solved! Go to Solution.
06-12-2017 01:46 PM
Hi boy,
when you want to "insert" into an (existing) array you should not initialize the array…
And instead of "inserting into an array" you surely want to "build an array by appending new elements"!
Please do the basic LabVIEW courses to learn about array handling.
And learn about i/o tunnels of loops and the options they provide!
06-12-2017 02:27 PM
Yes, thank you for replying to me...
However you telling me to review the videos that I already watched doesn't help me... If it's so easy then would you be able to show me a sketch of what I should do for my code?
Please?...
06-12-2017 02:59 PM
I figured it out. If it helps anyone, attached is the picture of a simplified version of inputting elements to an array. The first element out of the for loop was 1.5, and the last was 6.
06-12-2017 03:14 PM
Here are some other methods to achieve the same thing. Not sure, I assume you don't, want to keep things from previous runs. See what happens when you run your VI a few times. (Hint: Download the pict and drag it into block diagram.)
PS Don't mind GerdW. His idea of wit is nothing but an insightful comment placed with impeccable timing.
06-13-2017 01:30 AM - edited 06-13-2017 01:30 AM