Matlab code from MATAB Programming Course