%FILIP_SC is a script that can be used to produce trajectories of Figure 6.8.

% last modified by S. H. Zak , December 6, 2002


clear
tspan=[0 10];
x_0=2;
[t,x]=ode23s('filippo',tspan,x_0);
plot(t,x)
axis([0 10 -5 5])
xlabel('Time (sec)','Fontsize',12)
ylabel('x','Fontsize',12)
title('Plots of the state versus time for dx/dt=1-2*sign(x)','Fontsize',12)
grid
hold on
set(gca,'Fontsize',12)
x_0=-3;
[t,x]=ode23s('filippo',tspan,x_0);
plot(t,x)
x_0=-1;
[t,x]=ode23s('filippo',tspan,x_0);
plot(t,x)
x_0=4;
[t,x]=ode23s('filippo',tspan,x_0);
plot(t,x)
x_0=5;
[t,x]=ode23s('filippo',tspan,x_0);
plot(t,x)
x_0=-5;
[t,x]=ode23s('filippo',tspan,x_0);
plot(t,x)
hold off
