Plot multivariable function,can't get the plot right ?
Afficher commentaires plus anciens
I need to plot a multivariable (x,y) function in matlab and find its critical points. I plotted it but can't seem to get the correct plot as shown in the picture.
[x,y] = meshgrid(-5:.2:5);
f=3.*x.*exp(y)-x.^3-exp(3.*y);
fa1 = gradient(f, 0.2, 0.2); % Derivative
zv = contour(x,y,fa1, [0; 0]); % Critical Points
figure(1)
surf(x,y,f)
hold on
plot3(zv(1,2:end), zv(2,2:end), zeros(1,size(zv,2)-1), 'r', 'LineWidth',2)
hold off

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Pole and Zero Locations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!