clear
t=-1.5:0.001:1.5;plot(t,mu1mu2(t),t,1-mu1mu2(t));grid
set(gca,'Fontsize',12)
xlabel('Universe of discourse','Fontsize',12)
ylabel('Membership','Fontsize',12)
title('Memebership functions used in Example 8.13','Fontsize',12)
figure
tspan=[0 7];
x0=[1.2 0 0 0]';
[t,x]=ode45('stick_b2',tspan,x0);
plot(t,x(:,1));
set(gca,'Fontsize',12)
xlabel('Time (sec)','Fontsize',12)
ylabel('{\it x}_1 (rad)','Fontsize',12)
title('{\it x}_1 versus time for two different initial conditions in Example 8.13','Fontsize',12)
grid
hold
x0=[0.6 0 0 0]';
[t,x]=ode45('stick_b2',tspan,x0);
plot(t,x(:,1));
hold off
figure
tspan=[0 7];
x0=[1.2 0 0 0]';
[t,x]=ode23s('stick_b2',tspan,x0);
plot(t,x(:,3));
set(gca,'Fontsize',12)
xlabel('Time (sec)','Fontsize',12)
ylabel('{\it x}_3 (m)','Fontsize',12)
title('{\it x}_3 versus time for two different initial conditions in Example 8.13','Fontsize',12)
grid
hold
x0=[0.6 0 0 0]';
[t,x]=ode23s('stick_b2',tspan,x0);
plot(t,x(:,3));
hold off




