08-18-2010 04:56 PM
Hi,
In my old program, clip.vi (attached) was used. Now, I'd like to use Y[i]=clip{X[i]}.vi (under signal processing->singal operation) instead. But, the output seems different if I use the new VI.
My inputs are array and I'm using Laview 2009.
Thanks,
Jay
Solved! Go to Solution.
08-18-2010 06:53 PM
Where did you get your VI from?
It does not do the same thing as Clip VI on the palette. That one takes the array and forces any values out of range to be at the limits of the range. (Actually, I have no idea why this VI exists as you can just pass the array through an In Range and Coerce function.)
Your VI removes any elements that are out of range It doesn't "clip" them to the range, it out right removes them. So the remaining array becomes shorter, and any elements that are after an out of range element get shifted towards the beginning of the array.
08-19-2010 03:36 PM - edited 08-19-2010 03:45 PM
Actually, I have no idea why this VI exists as you can just pass the array through an In Range and Coerce function.
There are two reasons:
1. Getting more time to relax by waiting for the VI to complete.
2. Getting a reason to beg for an new machine with 64 bit OS and a lot of GByte of RAM.
BTW: The times displayed are in milliseconds for an array of 4000000 elements.
I ran into an optimization trap. The zero value for In Range and Coerce will only occur when you don't use any output. I added a wire to compare if the arrays are identical. Now I get 200 ms for the In Range and Coerce and 250 ms for Clip.vi.
08-19-2010 03:45 PM
Thank you so much for your reply. I understood the problem now.
Best,
Jay
08-19-2010 03:53 PM
I ran out ot editing time.
Another thing: the In Range and Coerce function will also run out of memory. I expected that this primitve will work on the same memory and does ot make a copy.
08-19-2010 08:26 PM
Okay Jay,
Why would you pick Waldemar's message as the solution to your problem?
You asked why they were different and I told you.