Loop Through String Array Javascript Iterations Matlab