How to draw a three-dimensional function image corresponding to the analytic expression of a given piecewise function image
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1670021/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1670026/image.png)
How do I draw this image in code
0 comentarios
Respuesta aceptada
Torsten
el 16 de Abr. de 2024
Editada: Torsten
el 16 de Abr. de 2024
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))
Más respuestas (0)
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!