...
Create bending_stress function
function sigma_x = bending_stress(M,ro,ri)
I = pi*(ro^4 - ri.^4)/4;
Save sigma_x = 1e-6*M*ro./I; Save this as bending_stress.mMake a copy of beam3.musing Save As ... call the new file beam5.m
Comment out
I = pi*(ro^4 - ri.^4)/4;
sigma_x = 1e-6*M*ro./I; Call Call function bending_stress
sigma_x = bending_stress(M,ro,ri); Run
Run and check output