Plot multivariable function,can't get the plot right ?
显示 更早的评论
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

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Pole and Zero Locations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!