function [sys,x0]=limintm(t,x,u,flag, lb, ub, xi)
%LIMINTM Limited integrator implementation.

%	Copyright (c) 1990-94 by The MathWorks, Inc.

if abs(flag) == 1
	if (x <= lb & u < 0)  | (x>= ub & u>0 )
		sys = 0;
	else
		sys = u;
	end
elseif flag == 3
	sys = x;
elseif flag == 0
	sys=[1,0,1,1,0,0]'; x0=xi;
else 
	sys = [];
end
