Wave function based on MATLAB