export results to .m file

The .m file can be directly run in MATLAB.