07-03-2014 05:19 AM
Hello all,
Can you please tell me if anyone have better idea. I want to replace “-ve” numbers in array between “+ve” Numbers.
Sometimes bit difficult to get the better Idea. 😛 😛
Solved! Go to Solution.
07-03-2014 05:44 AM
Hi munna232,
You want to replace +ve numbers instead of -ve numbers in an array or to place -ve numbers between +ve numbers in array ?
07-03-2014 06:04 AM
You mean something like this?
07-03-2014 09:27 AM
I want to replace only -ve numbers between +ve Numebrs like my sample VI.
Suppose my data is,
-1,-1,2,-1,-1,-1,5,6,-1,-1,-1,8,9,10,-1,-1
Result: -1,-1,2,100,100,100,5,6,100,100,100,8,9,10,-1,-1
07-03-2014 09:31 AM
Hi Munna,
search the first and the last positive number in your array. Then replace negative numbers only between them - use their index as start/stop-condition of your loop…
first = index of first positive number last = index of last positive number FOR i= first TO last if a[i]<0 then a[i]=100 NEXT
07-03-2014 09:43 AM
Hi GerdW,
Could you please give me Snippet/sample VI.
07-03-2014 09:45 AM
Check this.
Is it Rubed
07-03-2014 10:43 AM - edited 07-03-2014 10:44 AM