Produce an eggbox

Dear all, I should produce an eggbox. I tried to use this code, following the instructions, but I did not receive what I needed. Where's the error?
x=[-10:0.2469135802469136:+10]
y=[-10:0.2469135802469136:+10]
[X,Y]= meshgrid(x,y)
M1=sin(X)
M2=sin(Y)
M12=M1*M2
surf(X,Y)
X.^2
Thanks a lot

 채택된 답변

bym
bym 2011년 11월 9일

0 개 추천

The hint explicitly said element-by-element multiplication which is accomplished via
M12 = M1.*M2 % note the use of .*

댓글 수: 1

Image Analyst
Image Analyst 2011년 11월 10일
You forgot to tell him to use surf(M12) instead of surf(X, Y);

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Fangjun Jiang
Fangjun Jiang 2011년 11월 9일

0 개 추천

Do you mean your last line to be surf(X,Y, X.^2)? It plotted something but I don't know what is an eggbox.

댓글 수: 2

Orlando
Orlando 2011년 11월 9일
This is the exercise, and there is also an example of an eggbox.
<http://www.image-upload.net/viewer.php?file=uvu9z4g0endn7vsrubvw.jpg>
<http://www.image-upload.net/viewer.php?file=ommgobtzw9ymdwzo2rq.jpg>
<http://www.image-upload.net/viewer.php?file=i0xmzjlh0hd7yaclqwrz.png>
Thanks a lot
Fangjun Jiang
Fangjun Jiang 2011년 11월 10일
You call the MATLAB logo an egg box? Mr. Little and Mr. Moler will be mad.

댓글을 달려면 로그인하십시오.

Image Analyst
Image Analyst 2011년 11월 10일

0 개 추천

Change the last two lines to
M12 = M1 .* M2
surf(M12)

카테고리

도움말 센터File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

태그

질문:

2011년 11월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by