Rules | Recent posts | topic RSS | Search | Register  | Log in

find maximum number in an array

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Software Problems, Hints and Reviews
Author Message
roykyn



Joined: 15 Sep 2006
Posts: 232
Helped: 7


Post09 May 2008 15:41   find maximum number in an array

find maximum number in an array....
the array looks like this........
there will be many peaks.....
i need to find this maximum value with minimum comparisons..............
any ideas......Idea



Sorry, but you need login in to view this attachment

Back to top
sajjadi335



Joined: 28 Feb 2006
Posts: 16


Post09 May 2008 17:14   Re: find maximum number in an array

Well, first of all what language is to be used? Or maybe hardware??? If matlab, use max! but that should not be your problem, is it?
Back to top
roykyn



Joined: 15 Sep 2006
Posts: 232
Helped: 7


Post10 May 2008 8:46   Re: find maximum number in an array

well its matlab.....c is also ok.....here all the values's are not stores in an array....if that was so then MAX would be fine...here every point value have to be calculated by an equation....like if i give value 25 it gives the value in that curve........if i calculate all of it.....it looks like that figure......since calculating all points takes time......i want to reduce it......but the point distribution is not random....but like a bell curves....so by finding whether the curve is rising or decreasing......we can jump from one point to another....forward jump if rising....backward jump if falling....the no of points jumped decreases if backward....then we can find it i think.....has any one done this..........


Sorry, but you need login in to view this attachment

Back to top
sajjadi335



Joined: 28 Feb 2006
Posts: 16


Post17 May 2008 8:26   Re: find maximum number in an array

First, maybe you could rewrite your function with Symbolic toolbox, and that would be able to find the maxima/minima.
Second, the algorithm you tried to explain is a gradient-descent algorithm (or Conjugate Gradient algorithm). You could easily find data on it in MATLAB, and most probably M-files one the net.
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> Software Problems, Hints and Reviews
Page 1 of 1 All times are GMT + 2 Hours


Abuse
Administrator
Moderators
topic RSS 
sitemap