Matlab code for projects