adding MATLAB code