Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

find maximum number in an array

Status
Not open for further replies.

roykyn

Full Member level 5
Full Member level 5
Joined
Sep 15, 2006
Messages
253
Helped
12
Reputation
24
Reaction score
5
Trophy points
1,298
Activity points
2,704
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:
 

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?
 

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..........
 

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.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top