07-14-2010 09:15 AM
I have two input strings that give me the start and finish of some data, I also have an input string for the size of the steps between the elements, is there any simple way I can use this information to create an array or am I going to have to use loops?
07-14-2010 09:22 AM
Signal Processing >>> SIgnal Generation >>> Ramp Pattern.vi
Ben
07-14-2010 09:53 AM
... and
Functions >> String >> String/Number Conversion >> Fract/Exp String To Number, just to convert the range and step strings to proper numbers... 😉
07-14-2010 11:20 AM
This is kind of working but I'm having problems when I get fractions , or my step size is even but I want to end on an odd number (starting from an even). Any ideas. Shall I start using loops, I'll probably try tomorrow, i'm getting tired now.
07-14-2010 11:25 AM
If sleeping in it does not help, then post images of your code so far so we can comment.
Hint:
There is a quotient and remainded funtion on the Numerics pallete.
Ben
07-14-2010 11:28 AM
@Pazmush wrote:
This is kind of working but I'm having problems when I get fractions , or my step size is even but I want to end on an odd number (starting from an even). Any ideas. Shall I start using loops, I'll probably try tomorrow, i'm getting tired now.
Try changing the value of the "exclude end?" input parameter.
07-14-2010 11:31 AM
If you have LV9 you do not need to use loops. See the example. You could change the controls to strings if you want, but I wouldn't.
There is nothing wrong with using loops. This example is just for fun, the limits of LV recursion make the loop solution better.
About the last value, what do you expect the behavior to be? Let's us say you have start 1.0, stop 2.1, step 0.2. My example gives you 1.0, 1.2,...2.0. Easy modification would include 2.2, but I don't think that makes sense. Do you want 1.0, 1.2, ...2.0, 2.1. Or do you want the step size adjusted and the number of steps fixed? Too many combinations to mention.
07-14-2010 12:11 PM