I do not know why this is not plotting the multivariable function correctly?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Surface and Mesh Plots 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!