2. Bar AB has a rectangular cross section which is 10 x 24 mm. For the given loading, write a MATLAB
program that can be used to find the principal stresses and max shear stress at Points H and K for values
of d from 0 to 120 mm, using 15-mm increments. Use the results from problem 1 as benchmark values.
Your code should output six variables as vectors: $\sigma_{p1}$, $\sigma_{p2}$, $\tau_{max}$ for both H and K. Each of these six
variables is a function of d. You should plot your results in a format that makes them easy to visualize.
In other words, plot variables on the same axis which have results of a similar magnitude. Plot
quantities that can be naturally compared with each other. Use legends. Where a quantity is zero
throughout, you do not need to provide a plot, but you should state this in the summary. Include
appropriate plots in your summary Word or pdf file and include a discussion of key findings.