How to generate a surface by a function defined by two sentences?

조회 수: 2 (최근 30일)
João Micheletti
João Micheletti 2021년 7월 21일
댓글: João Micheletti 2021년 7월 21일
I would like to generate a graphic like this:
(I'm using >> [X,Y]= meshgrid(0:0.01:1,0:0.01:1);
surf(X,Y,X.*Y);
colorbar. To generate this figure).
But for a function defined by two sentences:
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 7월 21일
z = cos(2*pi*Y);
mask = X>0;
z(mask) = z(mask) + X(mask).^2.5;
surf(X, Y, Z)

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by