function BeamElementMomentDiagram(f,L) % BeamElementMomentDiagram x = [0;1]; z = [-f(2); f(4)]; plot(x,z,x,zeros(2,1),'k') title('Bending Moment Diagram'); endfunction