Typescript Array Count Function Matlab Simulink