Hello friends,
I'm trying to recreate the image of a spiral staircase attached but I cant seem to get my code working. I just get a blank graph. I don't know how my loop is just giving me one point. Please help!
function z=my_staircase(a,b,h,n)for t=0:2*pi*n r=((a*b)*exp(-.04*t))/sqrt((b*cos(t)^2)+ (a*sin(t))^2); x=r*cos(t); y=r*sin(t); z=(h*t)/(2*pi*n);endhold on plot3(x,y,z) xlabel('x(m)'); ylabel('y(m)');zlabel('z(m)'); grid on
Best Answer