While Loop Array Javascript Append Function Matlab Simulink Electrical Circuit