this is code correct

3 visualizaciones (últimos 30 días)
Aminata camara
Aminata camara el 19 de Mzo. de 2021
Comentada: Walter Roberson el 17 de Oct. de 2023
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])

Respuestas (3)

Star Strider
Star Strider el 19 de Mzo. de 2021
It appears to be correct, and the code runs without error.
  2 comentarios
Aminata camara
Aminata camara el 19 de Mzo. de 2021
Thank you so mcuh
Star Strider
Star Strider el 19 de Mzo. de 2021
My pleasure.
Chnage it to:
fsurf(f,[-2 2 -2*pi 2*pi])
.

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 19 de Mzo. de 2021
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 comentarios
Aminata camara
Aminata camara el 19 de Mzo. de 2021
thank you for the suggestion so then I just replace fimplicit by fsurf in the code?
Walter Roberson
Walter Roberson el 19 de Mzo. de 2021
yes

Iniciar sesión para comentar.


Maria Quennie
Maria Quennie el 17 de Oct. de 2023
plot function 0 ≤ 𝑥 ≤ 2𝜋 using sin2(x)
  1 comentario
Walter Roberson
Walter Roberson el 17 de Oct. de 2023
I do not understand how this solves the original question? Please expand on how making this plot would help the original poster?

Iniciar sesión para comentar.

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by