LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create a vector

Hello!
 
I want to create a vector from a to b with an interval of 0.01 like this
 
vector=[a a+0.01 a+0.01*2 a+0.01*3..........b]
 
Which block have I to use to build this veactor as most efficient as possible.
 
Thank you!!!
 
Larson
0 Kudos
Message 1 of 2
(2,758 Views)

You want to use a FOR loop that has a constant wired to the "N" node equal to the number of values in the vector. Create a second constant outside the loop that has the value for "a" in it.

Now inside the loop, multiply the "i" node time 0.01, and add the result to the value coming from the "a" constant. Wire the output of the addition out through the wall of the loop, connect it to an array indicator and you're done...

The first time through the loop, i = 0  so you will calculate: a + (0.01 * 0) or a; the second time through the loop it will calculate a + (0.01 * 1) or
 a + 0.01; and so on.

Mike...

Message Edited by mikeporter on 08-29-2005 12:50 PM


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 2
(2,754 Views)