Matlab Split String Into Character Array Javascript Iteration