matlab code and results