MATLAB prototype code