12-29-2009 05:35 AM
Hi all!
Can someone help me find the max value lower than another value in an array?
example:
20 35
30 48
45 70
if I need the max value under 50, the biggest value would be 48. the value 70 would be ignored or taken out of the array...
Any help?
Thanks in advance and happy holidays
Solved! Go to Solution.
12-29-2009 05:44 AM
hi
what you need is a sorting with a double condition :
if y(i)>y(i+1) AND < limit then keep y(i)
it's easy to implement, depending upon the size of the graph the approach is more or less costly. if the array are veeery big make a search on the forum, there are some examples.
N
12-29-2009 06:40 AM
12-29-2009 07:31 AM
Without a loop, you can also do it this way
12-29-2009 07:37 AM
Thanks
I was going in circles and it was very simple... This is howdid it
Maybe yous is better,jcarmody but I need the array intact to know the element position in the array
Any idea how I should know what index the value has in the array to identify the position of the value?
Now I need to know what
12-29-2009 07:41 AM
I am reading this line the 4th time. a bit complex for me. ok did you check out the idea i suggested? the output of the array max-min will give you the index value as well.
12-29-2009 07:41 AM
12-29-2009 07:45 AM
Mine doesn't work... I didn't test it... 😞
12-29-2009 07:47 AM
12-29-2009 07:54 AM