How to generate a surface by a function defined by two sentences?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I would like to generate a graphic like this:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/691603/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/691603/image.jpeg)
(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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/691608/image.png)
2 comentarios
Walter Roberson
el 21 de Jul. de 2021
z = cos(2*pi*Y);
mask = X>0;
z(mask) = z(mask) + X(mask).^2.5;
surf(X, Y, Z)
Respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots 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!