LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

index array

Simple question,

 

How do I set up an index array?  I'm used to using Matlab where it would look something like:  t = 0:0.5:3; So the array would be

 

[0 .5 1 1.5 2 2.5 3]

 

How do I do something like that in Labview?

 

Thanks

0 Kudos
Message 1 of 9
(2,599 Views)

Programmatically, use the ramp by delta mode of ramp pattern.

0 Kudos
Message 2 of 9
(2,593 Views)

Use the Ramp Pattern function, by delta instance, as shown:

Ramp by Delta.png

0 Kudos
Message 3 of 9
(2,590 Views)

By the way, what you are asking for is not called "index array" in LabVIEW.  Index Array in LabVIEW refers to a specific function in LabVIEW that return an element or portion of an array (entire row or column of a 2-D array).

 

The Ramp Pattern function in LabVIEW is more like what you are asking for where you can enter the start and stop values and a number of samples and it will return an array.

0 Kudos
Message 4 of 9
(2,588 Views)

Christian, Nathan,

 

By any chance was the polymorphic version of ramp pattern added after LV 2009?

 

I knew there was a polymorphic version.  But by chance, I happened to have LV 2009 open when I went to look for it.  Using Quick Drop, I search for Ramp, found Ramp Pattern, and when I dropped it, it only came up with the "# of samples version".  Even going to drop it by its location on the Signal Generation palette, it didn't give me the poly version.

0 Kudos
Message 5 of 9
(2,581 Views)

Yes, the polymorphic version is relatively recent. Don't remember when it was introduced.

0 Kudos
Message 6 of 9
(2,576 Views)

@altenbach wrote:

Yes, the polymorphic version is relatively recent. Don't remember when it was introduced.


LV10

0 Kudos
Message 7 of 9
(2,572 Views)

Thanks a lot this is exactly what I wanted.

 

Say I want to plot a cosine function using my example from before.  If I set up the ramp from 0 to 3 using .5 increments and measure the output with the graphing tool, it's going to plot the function from 0 to 6.  How do I get it to correctly plot from 0 to 3?

 

Thanks again

0 Kudos
Message 8 of 9
(2,557 Views)

Where are you plotting it?

 

If you are plotting it on a Waveform chart or graph, using just the double array, then you need to set your dX value for the graph.

 

If you are using an XY graph, then you need to bundle your X and Y values together.

 

Either way, look at the help for the type of graph or chart you are using.

0 Kudos
Message 9 of 9
(2,552 Views)