Appendix MATLAB codes for 2D cantilever beam case