function ise=ise(t,y)
% This is the function ise.m
% Simple integration routine made for computing ISE of time signal usubg trapez integration
%
%    y - time signal vector
%    t - time signal vector



% Initialize
ise=0;
i=1;
npoints=length(t); 

% Integrate
while i  < npoints,

  yavg = (y(i) + y(i+1))/2;
  dt = t(i+1) - t(i);
  int = yavg*yavg*dt;
  ise = ise + int;
    i=i+1;
  
end

