% This program (script) tests the functions for computing the shear and % moment functions. The results are ploted in two seperate plots. % Input data load = [4, -100]; % distance, force; distance, force; ... length = 10; steps = 40; % Create an array x containing the locations along the shaft or beam x = 0:length/steps:length; % Compute the Shears and Moments for i=0: steps; [v(i+1),f1,f2]=Shaft_Shear(x(i+1), load, 0, 10); [m(i+1),f1,f2]=Shaft_Moment(x(i+1), load, 0, 10); end % Plot the shear curve subplot(1,2,1); plot(x,v); xlabel('Distance along Shaft') ylabel('Shear') title('Shear Along Shaft') % Plot the moment curve subplot(1,2,2); plot(x,m); xlabel('Distance along Shaft') ylabel('Moment') title('Moment Along Shaft')