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

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)
João Micheletti
João Micheletti 2021 年 7 月 21 日
It worked, thanks

サインインしてコメントする。

回答 (0 件)

カテゴリ

製品

リリース

R2021a

質問済み:

2021 年 7 月 21 日

コメント済み:

2021 年 7 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by