MATLAB: No line on plot3 graph

no line; separated data

My line is missing and all the data are being separated.
How to rejoin to become a line?
please help me.
#No marker is required.
z = meshgrid(0:0.1:50)
x = exp(-0.03*z).* sin(z);
y = exp(-0.03*z).* cos(z);
figure
plot3(x,y,z)
xlabel('x')
ylabel('y')
zlabel('z')

Best Answer

You do not need meshgrid with plot3.
This works:
z = (0:0.1:50);
x = exp(-0.03*z).* sin(z);
y = exp(-0.03*z).* cos(z);
figure
plot3(x,y,z)
xlabel('x')
ylabel('y')
zlabel('z')
grid on
and your spiral appears!