Given a function ๐‘ง(๐‘ฅ,๐‘ฆ)=10sin ๐‘ก.where ๐‘ก=โˆš๐‘ฅ2+๐‘ฆ2.
Create a figure containing of twodifferent three-dimensional subplots (i.e. mesh and contour plots) of the function ๐‘ง(๐‘ฅ,๐‘ฆ)where both ๐‘ฅ and ๐‘ฆ are ranging from -10 to 10. For both subplots, label the axes and showthe color bar to identify the variation of z.
x=linspace(-10,10);
y=linspace(-10,10);
t=sqrt(x.^(2)+y.^(2));
Z = 10*sin(sqrt(x.^(2)+y.^(2)));
%graphing
figure(1)
mesh(Z);
xlabel('x')
ylabel('y')
zlabel('10 sin(t)')
figure(2)
contour3(Z);
xlabel('x')
ylabel('y')
zlabel('10 sin(t)')
What went wrong actually?
No graph were plotted when run

 ์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Walter Roberson
Walter Roberson 2020๋…„ 12์›” 31์ผ

2 ๊ฐœ ์ถ”์ฒœ

x=linspace(-10,10);
y=linspace(-10,10) .'; %CHANGED
t=sqrt(x.^(2)+y.^(2));
Z = 10*sin(sqrt(x.^(2)+y.^(2)));
%graphing
figure(1)
mesh(Z);
xlabel('x')
ylabel('y')
zlabel('10 sin(t)')
figure(2)
contour3(Z);
xlabel('x')
ylabel('y')
zlabel('10 sin(t)')

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

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

์งˆ๋ฌธ:

2020๋…„ 12์›” 31์ผ

๋‹ต๋ณ€:

2020๋…„ 12์›” 31์ผ

Community Treasure Hunt

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

Start Hunting!

Translated by