Info

This question is closed. Reopen it to edit or answer.

How can i write correct this function?

2 views (last 30 days)
V B
V B on 18 Oct 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I can't write this function in order to be correct and make its graphic in mesh. Please help me.

Answers (2)

V B
V B on 18 Oct 2014

Star Strider
Star Strider on 18 Oct 2014
This is how I would do it:
x = linspace(0,pi);
y = linspace(-1,1);
[X,Y] = meshgrid(x,y);
z = @(x,y) sin(x-2.*y).^2 .* exp(-abs(y));
Z = z(X,Y);
figure(1)
mesh(X, Y, Z)
grid on

Community Treasure Hunt

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

Start Hunting!