Employ the subplot function to display all the plots on the same figure window.

Answers (1)

wo = 2.5;
E = 50000;
L = 600;
I = 30000;
delx = 10;
x = [0:delx:L];
y = (wo/(120*E*I*L))*(-(x.^5) + 2*L^2*x.^3 - x*L^4);
theta = (wo/(120*E*I*L))*(-(5*x.^4) + 6*L^2*x.^2 - L^4);
mo = (wo/(120*L))*(-(20*x.^3) + 12*L^2*x);
s = (wo/(120*L))*(-(60*x.^2) + 12*L^2);
subplot(2,2,1),plot(x,y)
grid
title('Beam Deformation')
ylabel('Displacement')
xlabel('Distance along Beam (cm)')
subplot(2,2,2),plot(x,theta)
grid
title('Slope')
ylabel('Slope')
xlabel('Distance along Beam (cm)')
subplot(2,2,3),plot(x,mo)
grid
title('Moment')
ylabel('Moment')
xlabel('Distance along Beam (cm)')
subplot(2,2,4),plot(x,s)
grid
title('Shear')
ylabel('Shear')
xlabel('Distance along Beam (cm)'

Asked:

on 26 Sep 2019

Answered:

on 26 Sep 2019

Community Treasure Hunt

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

Start Hunting!