ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an equispaced 1D array

Other than using a for loop, is there a quick way (or trick) of creating an equispaced array of numbers with min, max and number of points / spacing specified ? A bit like the Matlab linspace function.

 

Given max = 10, min = 9, and spacing = 0.1, get 9,9.1,9.2,9.3,..., 10.

0 Kudos
Message 1 of 3
(3,936 Views)

Look at Ramp Pattern.vi under Signal Processing >>  Signal Generation palette.

Message 2 of 3
(3,927 Views)

In this thread I show one way to do it without using a loop.

 

http://forums.ni.com/t5/LabVIEW/Creating-an-array-when-you-have-the-first-and-last-element-and/m-p/1...

 

In LV10 you can use the Ramp.vi and select Ramp by Delta.  If you peek under the hood, you may be disappointed to discover a For Loop.

 

In the old days, LV was very slow when it came to loops and I often had to resort to external code (CINs) to generate even modest integer arrays.  These days things are much better, so I don't fully understand the aversion to loops.  Smiley Wink

Message 3 of 3
(3,922 Views)