find a max value in function
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
In Yeob Kim
am 22 Mai 2019
Bearbeitet: madhan ravi
am 22 Mai 2019
[x,y] = meshgrid(-2 : 0.5 : 2 , -5 : 0.5 : 5);
z = ( 5*x.^2 )+( y.^3 )+10*x;
mesh(x,y,z);
xlabel('x-axis');
ylabel('y-axis');
zlabel('z-axis');
i'm troble in this problem
i ask something this problem, present i make a 3dimension function graph
and i want find a max value , min value in z and add mark to max value , min value
please help me
i'm not good at englinsh. sorry
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 22 Mai 2019
Add the below after mesh() call:
mx = z==max(z(:));
mn = z==min(z(:));
hold on
plot3(x(mx),y(mx),z(mx),'ok')
plot3(x(mn),y(mn),z(mn),'or')
2 Kommentare
madhan ravi
am 22 Mai 2019
If you have repeated max or min use find()
mx = find(z==max(z(:)));
mn = find(z==min(z(:)));
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations 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!