Matlab script to compare to python