04-22-2010 10:30 AM
Dear All,
I would like to find and replace the highest value among a set of values being polled. I only manage to find the highest value if i compare the new value with the old value using a shift register with a single value (element) only.
Right now, if i am dealing with array inputs instead of single value, how should i do it?
Example:
New Input1=[5
4
3
2
1]
Input 2= [ 4
3
5
3
3]
Therefore the answer should be x= [5
4
5
3
3]
Then if another new input array has higher values then x, the answer will again be modified.The values are compared by row versus row of each elements in the array. The final answer should be in array form.
Can anyone help out with this? Thank you so much!
Solved! Go to Solution.
04-22-2010 10:36 AM - edited 04-22-2010 10:37 AM
One way, this is the first one that jumped to mind. May be an easier one out there.
04-22-2010 10:47 AM
04-22-2010 10:51 AM
Have you tried the following labview function?
Array Max & Min Function
04-22-2010 11:08 AM
Dear else and for,
My input is forever polling there so do i need any shift register to keep track of the last highest value array? By the way, can you tell me what functions icon you use, i cant find the icon? Can attach the VI or snippet?
04-22-2010 11:23 AM - edited 04-22-2010 11:26 AM
newbieboy wrote:Dear else and for,
My input is forever polling there so do i need any shift register to keep track of the last highest value array? By the way, can you tell me what functions icon you use, i cant find the icon? Can attach the VI or snippet?
Use Tim's(elset191) solution. It's cleaner. I didn't know it accepted arrays. The function is max& min and is under programming->comparison.
As for your question about the shift register, you would then feed the (max,min) array into a shift register to be compared again next time.
04-22-2010 11:29 AM
04-22-2010 11:31 AM
elset191 wrote:
WINNER WINNER, CHICKEN DINNER
04-22-2010 11:48 AM
Dear Else,
I have attach my VI but i am not sure how come the max (x,y) is all zero?
Please help!
04-22-2010 11:51 AM