10-16-2014 08:02 AM
a=[0,100]
a<=5 => x=1
5<a<=10 => x=2
10<a<=95 => x=3
95<a<=98 => x=4
a>98 => x=5
Thank you.
Solved! Go to Solution.
10-16-2014 08:10 AM
if (a <= 5)
x = 1;
else if (a <= 10)
x = 2;
else if (a <=95)
x = 3;
else if (a <= 98)
x = 4;
else x = 5;
10-16-2014 09:02 AM - edited 10-16-2014 09:07 AM
10-16-2014 11:12 AM
@GerdW wrote:
Why use a formula node?
GerdW, you need to add a max value to the end of your array (whatever the max I32 value is).
10-17-2014 01:15 AM
10-17-2014 06:18 AM
Thanks for your help. But i need this solution in formula node and i think i fix it. Now its working.
if (x<= 5)
a = 1;
else if (x <= 10)
a = 2;
else if (x < 95)
a = 3;
else if (x < 98)
a = 4;
else if (x >= 98)
a = 5;
10-17-2014 09:05 AM
Then you should mark BowenM's message as the solution to your question since he was the one who provided you the code that you are now marking as the solution in your message.
Actually your last message is wrong since you've gone and swapped the variables a and x from what you had originally described in your original question.
Please go to the Options menu to the upper right of your last message, pick unmark as solution, then go and mark BowenM's message as the solution.
If it was me, I'd use Gerd's code since it keeps it all in pure LabVIEW functions.
10-17-2014 09:12 AM
You copy my code, add an error (given your initial request), post it, and mark it as solution? Rude.