How to draw a three-dimensional function image corresponding to the analytic expression of a given piecewise function image

14 ビュー (過去 30 日間)
How do I draw this image in code

採用された回答

Torsten
Torsten 2024 年 4 月 16 日 10:01
編集済み: Torsten 2024 年 4 月 16 日 11:49
f = @(x,y)(4*y-4*x.*y-2*y.^2).*(y<x).*(x+y<1)+2*(1-x).^2.*(y<x).*(x+y>=1)+(4*y-4*y.^2-2*x.^2).*(y>=x).*(x+y<1)+(2-4*x+4*x.*y-2*y.^2).*(y>=x).*(x+y>=1);
nx = 20;
ny = 40;
x = linspace(0,1,nx);
y = linspace(0,1,ny);
[X,Y] = meshgrid(x,y);
surf(X,Y,f(X,Y))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by