Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

I am trying to plot a 3D figure defined by z>=0:

1 visualización (últimos 30 días)
Sultan Al-Hammadi
Sultan Al-Hammadi el 13 de Oct. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I triY(I),Z(I),'.'); xlabel('X'); ylabel('Y'); zlabel('Z');
Please help me

Respuestas (1)

Bruno Luong
Bruno Luong el 13 de Oct. de 2018
Editada: Bruno Luong el 13 de Oct. de 2018
x = linspace(-2,2,50);
y = linspace(-2,2,50);
z = linspace(-0.1,2,50);
x = reshape(x,[],1,1);
y = reshape(y,1,[],1);
z = reshape(z,1,1,[]);
R2 = x.^2+y.^2+z.^2;
I = R2>=1 & R2<=4 & z>=0;
isosurface(x,y,z,I,0.5); % 0.5 is middle of 0 and 1
axis equal
  4 comentarios
Sultan Al-Hammadi
Sultan Al-Hammadi el 14 de Oct. de 2018
thanks a lot
madhan ravi
madhan ravi el 14 de Oct. de 2018
Accept the answer if it was useful and helpful

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by