% class_demo_2_call.m
% class demo of Matlab Function fcn and f(u)fcn
clc, clear all, close all

A=1; B=3;
tfinal=1.5*(2*B/A);
sim('class_demo_2')
t=t_x_y_z(:,1);
x=t_x_y_z(:,2);
z=t_x_y_z(:,3);
y=t_x_y_z(:,4);

plot(t,x,'b',t,y,'r')
hold on
plot(t,z,'k','Linewidth',3)
axis([0 tfinal -2 1.05*max(max(x),max(y))])
xlabel('t')
ylabel('x, y, z')
title('x,y,z vs t')
legend('x','y','z','location','southeast')

figure
w=t_w(:,2);
plot(t,x,'b',t,y,'r')
hold on
plot(t,z,'k','Linewidth',3)
plot(t,w,'g')
legend('x','y','z','w')