this is code correct

Hello I wanted to know if my code is correct for this type of equation
z = f(x, y) for 2 x ≤ 2 and −2𝜋 ≤ y ≤ 2𝜋
where
f(x, y) = e0.2x sin(2y)
THIS IS THE CODE I wrote
%Plot a function
f=@(x,y) (exp(-0.2.*x)).* sin(2.*y);
fimplicit(f,[-2 2 -2*pi 2*pi])

Answers (3)

Star Strider
Star Strider on 19 Mar 2021

0 votes

It appears to be correct, and the code runs without error.

2 Comments

Thank you so mcuh
My pleasure.
Chnage it to:
fsurf(f,[-2 2 -2*pi 2*pi])
.

Sign in to comment.

Walter Roberson
Walter Roberson on 19 Mar 2021

0 votes

The assignment to f appears to be correct, and the plotting bounds appear to be correct. However, nothing in the problem statement says that you are solving for f(x,y) = 0, so you should not be using fimplicit(). You should use fsurf() instead.

2 Comments

thank you for the suggestion so then I just replace fimplicit by fsurf in the code?

Sign in to comment.

Maria Quennie
Maria Quennie on 17 Oct 2023

0 votes

plot function 0 ≤ 𝑥 ≤ 2𝜋 using sin2(x)

1 Comment

I do not understand how this solves the original question? Please expand on how making this plot would help the original poster?

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Tags

Asked:

on 19 Mar 2021

Commented:

on 17 Oct 2023

Community Treasure Hunt

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

Start Hunting!