I do not know why this is not plotting the multivariable function correctly?
Show older comments
It do not know why MATLAB plots incorrectly the following function f(x,y) = x*(10y+3)*e^(-x^2-y^2)
This is the code I wrote:
x = -5:0.1:5;
y = -5:0.1:5;
[X,Y]=meshgrid(x);
syms x y;
f(x,y) = exp(-x.^2)*exp(-y.^2)*x*(10*y+3);
F = X*(10*Y+3)*(exp(-X.^2-Y.^2));
surf(X,Y,F);
f = (exp(-x.^2-y.^2))*(10*y*x+3*x); % This is not part of the question
set(gca,'FontSize',15)
xlabel('$x$','FontSize',20,'interpreter','latex');
ylabel('$y$','FontSize',20,'interpreter','latex');
title('$x*(10*y+3)*exp(-x^2-y^2)$','FontSize',15,'interpreter','latex');
And this is the output I got

Any ideas?
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!