Chapter 6: User Defined Functions, "MATLAB An Introduction With Applications",Amos Gilat, 3rd Edition