My MATLAB code