Subarrays Javascript Length Function Matlab Example