Locating max/min of 3d surface
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How could I go about locating the global min/max of a user input function. The GUI plots a function based on user input:
% Get the function
g=get(handles.funcxy,'String');
% Get the x limits
limit=[str2num(char(get(handles.xmin,'String'))),... str2num(char(get(handles.xmax,'String')))];
% Convert to inline for plotting
func=inline(char(g));
% Set axes to draw on
axes(handles.plot);
% Plot the surface defined by a function f(x,y)=func
ezsurf(func,limit);
I have figured out in order to find the z maximum I can do
sh=ezsurf(func,limit);
setappdata(0, 'function', char(g));
zd=get(sh,'zdata');
zmax=max(max(zd));
But how can I get the corresponding x,y points
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!