Finding the turning points
Ältere Kommentare anzeigen
Hi i want to ask about something, i want to solve and locate the turning points (maximum and minimum point) of a graph using matlab gui but i dont know how to code it. The function is user defined and here is my code:
funcString = get(handles.edit1,'String');
funcHandle = str2func(['@(x)' funcString]);
x = linspace(10,-10,100);
y = funcHandle(x);
plot(handles.axes1,x,y);
3 Kommentare
Torsten
am 1 Mai 2023
So you want to determine minima and maxima of the first derivative of your "funcHandle" ?
Reynand Joe
am 2 Mai 2023
Image Analyst
am 2 Mai 2023

Antworten (1)
John D'Errico
am 1 Mai 2023
0 Stimmen
If all you will use are the 100 coarsely sampled points you are plotting, then min and max will do what you want. Look at the second arguments returned from min and max. You could also use findpeaks.
If you are willing to use the function itself, then you might use fminbnd. Note that fminbnd always searches fro a minimum. But you could then search for the minimum of -f(x), which would be the maximum of f.
2 Kommentare
Reynand Joe
am 1 Mai 2023
Image Analyst
am 2 Mai 2023
Bearbeitet: Image Analyst
am 2 Mai 2023
Kategorien
Mehr zu Images finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!