Java While Loop Through Array Matlab Simulink Electrical Circuit