05-01-2012 01:33 PM
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
05-01-2012 01:54 PM - edited 05-01-2012 01:57 PM
Programmatically, use the ramp by delta mode of ramp pattern.
05-01-2012 01:57 PM
Use the Ramp Pattern function, by delta instance, as shown:
05-01-2012 01:58 PM
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.
05-01-2012 02:04 PM
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.
05-01-2012 02:10 PM
Yes, the polymorphic version is relatively recent. Don't remember when it was introduced.
05-01-2012 02:12 PM
@altenbach wrote:
Yes, the polymorphic version is relatively recent. Don't remember when it was introduced.
LV10
05-01-2012 02:29 PM
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
05-01-2012 02:34 PM
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.