02-16-2015 04:47 PM
This is something that has bugged me for a little while because I feel like there should be a much easier way to do this but after looking around for a while and not finding anything I figured I would ask. When working with arrays and XY graphs sometimes it is necessary to come up with a straight ascending array of the format [x, x+1, x+2, ..., X +(n-1), X + n] and while I know that this is reasonably straight forward to do with a FOR loop and auto-indexing I feel like there must be a VI somewhere that is able to do this much faster/easier/tidier.
Does anyone know of such a VI or have a different method of building these arrays?
Solved! Go to Solution.
02-16-2015 04:55 PM
Ramp Pattern.vi in the Signal Processing palette.
Lynn
02-16-2015 05:02 PM
Thanks.
I figured there was something like that but just getting the right terms to think/search for was causing problems. I'm not sure about faster, but it should definitely be tidier/easier.
02-16-2015 05:53 PM - edited 02-16-2015 05:56 PM
@ogk.nz wrote:
When working with arrays and XY graphs sometimes it is necessary to come up with a straight ascending array of the format [x, x+1, x+2, ..., X +(n-1), X + n] and while I know that this is reasonably straight forward to do with a FOR loop and auto-indexing I feel like there must be a VI somewhere that is able to do this much faster/easier/tidier.
Just a related comment: If all plots share the same x-values, it is much simpler to use a waveform graph and define x0 and dx for the x-axis. No ramp needed. (You can do that via property nodes or, even simpler, by bundling).
In your case ([x, x+1, x+2, ..., X +(n-1), X + n]) you only need to set x0, because dx remains at 1 (i.e. the default).