Php Get Max Index Of Array Matlab For Loop