Fixed Size Array Javascript Iterations Matlab Help