%% Specify State and Input Names for State-Space Model
% Create state-space matrices and specify sample time.

A = [0 1;-5 -2];
B = [0;3];
C = [0 1];
D = 0;
Ts = 0.05;

%
% Create the state-space model, specifying the state and input names using name-value pairs.

sys = ss(A,B,C,D,Ts,'StateName',{'Position' 'Velocity'},...
    'InputName','Force');

% The number of state and input names must be consistent with the dimensions of A, B, C, and D.
% Naming the inputs and outputs can be useful when dealing with response plots for MIMO systems.

step(sys)

% Notice the input name Force in the title of the step response plot.
% Copyright 2012 The MathWorks, Inc.