this is code correct

์กฐํšŒ ์ˆ˜: 1 (์ตœ๊ทผ 30์ผ)
Aminata camara
Aminata camara 2021๋…„ 3์›” 19์ผ
๋Œ“๊ธ€: Walter Roberson 2023๋…„ 10์›” 17์ผ
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) = eโˆ’0.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])

๋‹ต๋ณ€ (3๊ฐœ)

Star Strider
Star Strider 2021๋…„ 3์›” 19์ผ
It appears to be correct, and the code runs without error.
  ๋Œ“๊ธ€ ์ˆ˜: 2
Aminata camara
Aminata camara 2021๋…„ 3์›” 19์ผ
Thank you so mcuh
Star Strider
Star Strider 2021๋…„ 3์›” 19์ผ
My pleasure.
Chnage it to:
fsurf(f,[-2 2 -2*pi 2*pi])
.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.


Walter Roberson
Walter Roberson 2021๋…„ 3์›” 19์ผ
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
Aminata camara
Aminata camara 2021๋…„ 3์›” 19์ผ
thank you for the suggestion so then I just replace fimplicit by fsurf in the code?
Walter Roberson
Walter Roberson 2021๋…„ 3์›” 19์ผ
yes

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.


Maria Quennie
Maria Quennie 2023๋…„ 10์›” 17์ผ
plot function 0 โ‰ค ๐‘ฅ โ‰ค 2๐œ‹ using sin2(x)
  ๋Œ“๊ธ€ ์ˆ˜: 1
Walter Roberson
Walter Roberson 2023๋…„ 10์›” 17์ผ
I do not understand how this solves the original question? Please expand on how making this plot would help the original poster?

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Surface and Mesh Plots์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

Community Treasure Hunt

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

Start Hunting!

Translated by