hello ty for your attention
im a newcommer
i want a plot3 for this function but im confused and don't know what to do
z=y*exp(-x^2-y^2)
-3<=x,y<=3
I would be grateful if you guide me through this.

 採用された回答

Image Analyst
Image Analyst 2022 年 5 月 30 日

1 投票

Try meshgrid and linspace :
% -3<=x,y<=3
numElements = 200;
X = linspace(-3, 5, numElements);
Y = linspace(-3, 3, numElements);
[x, y] = meshgrid(X, Y);
z = y*exp(-x .^ 2 - y .^ 2);
surf(x, y, z, 'EdgeColor', 'none');
colorbar;

その他の回答 (0 件)

質問済み:

2022 年 5 月 30 日

回答済み:

2022 年 5 月 30 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by