close all
clear all

dt = 0.005;
tf = 2;  %seconds

N = tf/dt;

t = NaN(N,1);
I = NaN(N,4);

I(1,3) = 0;
I(1,4) = 0;

t(1) = 0;
curr_time = 0;

for i = 1:N
   
  t(i) = i*dt;

  if(i<N/2)
    ctrl = 0;
  else
    ctrl = 1;
  end
  I(i,2) = 1;
  I(i,1) = 1;
  I(i,4) = ctrl;

  [I] = Plant2(i,t,I);  
  
end


figure
plot(t,I(:,4),t,I(:,5),'-x')
legend('ctrl','Idump');
xlabel('time (s)');
ylabel('Amps');

