Php Json Encode Not Working With Array In Matlab For Loop