the question asks to subplot the contours any idea how?

조회 수: 4 (최근 30일)
dulanga
dulanga 2017년 3월 7일
댓글: KSSV 2017년 3월 8일
x = linspace (-1,1); y = linspace (-1,1); [X, Y] = meshgrid(x,y); Z=7*sin(pi.*X).*cos(3*pi.*X);
surf(X,Y,Z ) hold on contour(X,Y,Z) hold off
rotate3d on
the question asks to subplot the contours any idea how?

답변 (1개)

KSSV
KSSV 2017년 3월 7일
x = linspace (-1,1);
y = linspace (-1,1);
[X, Y] = meshgrid(x,y);
Z=7*sin(pi.*X).*cos(3*pi.*X);
subplot(211)
surf(X,Y,Z )
subplot(212)
contour(X,Y,Z)
rotate3d on
  댓글 수: 2
dulanga
dulanga 2017년 3월 7일
hi the second subplot just has a bunch of lines?
KSSV
KSSV 2017년 3월 8일
For your data the contour lines would be straight.

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

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by