corrected python MATLAB indice difference