3D plot rotate
Mostrar comentarios más antiguos
Hi all,
I have a 3D surf plotted in fig. 1 with axis X, Z and Y

Figure 1
I want to rotate the figure to get something like shown in fig.2

Figure 2
PS: Figure 2 is from book, I am just trying to generate similar figure using matlab. Both are same it's just about plotting in such a way that Y is in place of Z
2 comentarios
Tommy
el 16 de Abr. de 2020
Can you provide the code you used to generate the plot?
Aditya Rallapalli
el 16 de Abr. de 2020
Respuesta aceptada
Más respuestas (1)
Ameer Hamza
el 16 de Abr. de 2020
Editada: Ameer Hamza
el 16 de Abr. de 2020
Try this. Correct the vector order for y and z-axis.
x = 0:0.01:1;
z = 0:0.01:1;
[X,Z] = meshgrid(x,z);
y1 = zeros(size(X));
for i = 1:length(x)
for j = 1:length(z)
y1(i,j) = -sqrt(x(i) * z(j));
end
end
y2 = zeros(size(X));
for i = 1:length(x)
for j = 1:length(z)
y2(i,j) = sqrt(x(i) * z(j));
end
end
surf(X,y1,Z);hold on;
surf(X,y2,Z)

Categorías
Más información sobre Line Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

