I cannot get the following program to plot the variables w & P. I have noticed that the loop is only using the last variable but still does not plot the point. I'm not sure what is happening. Thank you!
clearclck=1000; c=50; M=200; m=2; e=0.1;vv=[20,40,0,0.5];for w=20:0.5:40 r=w*sqrt(M/k); wn=w/r; damp=c/2/M/wn; phi=atan((2*damp*r)/(1-r^2)); X=(m*e*r)/(M*sqrt((1-r^2)^2+(2*damp*r)^2)); F=m*e*w^2*sin(w); dx=w*X*cos(w-phi); T=2*pi*w; P=abs(F*dx); plot(w,P,'k','linewidth',2); axis(vv); grid on; hold on;endxlabel('Forcing Frequency (Hz)', 'fontsize', 12);title('Problem 7');ylabel('Mean Power Output (Hp)', 'fontsize', 12);
Best Answer