Professional Documents
Culture Documents
MATLAB Code For No.2: All All
MATLAB Code For No.2: All All
MATLAB Code For No.2: All All
2
-----------------------------------------------------------------------------
clear all
clc
close all
% State Space
sys = ss(A,B,C,D);
% The input
x0 = zeros(2,1001);
x0(1,:) = 0.2;
x0(2,:) = 0;
figure()
plot(t,y)
title('y(t) response')
xlabel('time(second)')
ylabel('y(t)')
figure()
plot(t,x(:,1))
title('u(t) response')
xlabel('time(second)')
ylabel('u')
figure()
plot(t,x(:,2))
title('\alpha (t) response')
xlabel('time(second)')
ylabel('\alpha')
figure()
plot(t,x(:,3))
title('\theta (t) response')
xlabel('time(second)')
ylabel('\theta')
figure()
plot(t,x(:,4))
title('q(t) response')
xlabel('time(second)')
ylabel('q')
----------------------------------------------------------------
Run Result: