%% State-Space Model with Inherited Properties
% For this example, create a state-space model with the same time and input unit properties inherited from another state-space model. Consider the following state-space models:
% A_1 =  \left[ {\begin{array}{cc}
%    -1.5 & -2 \\
%    1 & 0 \\
%   \end{array} } \right]\;\;\;\;
% B_1 =  \left[ {\begin{array}{c}
%    0.5\\
%    0 \\
%   \end{array} } \right]\;\;\;\;
% C_1 =  \left[ {\begin{array}{cc}
%    0 & 1 \\
%   \end{array} } \right]\;\;\;\;
% D_1 = 5\\
% A_2 =  \left[ {\begin{array}{cc}
%    7 & -1 \\
%    0 & 2 \\
%   \end{array} } \right]\;\;\;\;
% B_2 =  \left[ {\begin{array}{c}
%    0.85\\
%    2\\
%   \end{array} } \right]\;\;\;\;
% C_2 =  \left[ {\begin{array}{cc}
%    10 & 14 \\
%   \end{array} } \right]\;\;\;\;
% D_2 = 2
% First, create a state-space model sys1 with the TimeUnit and InputUnit property set to 'minutes'.

A1 = [-1.5,-2;1,0];
B1 = [0.5;0];
C1 = [0,1];
D1 = 5;
sys1 = ss(A1,B1,C1,D1,'TimeUnit','minutes','InputUnit','minutes');

% Verify that the time and input unit properties of sys1 are set to 'minutes'.

propValues1 = [sys1.TimeUnit,sys1.InputUnit]

% Create the second state-space model with properties inherited from sys1.

A2 = [7,-1;0,2];
B2 = [0.85;2];
C2 = [10,14];
D2 = 2;
sys2 = ss(A2,B2,C2,D2,sys1);

% Verify that the time and input units of sys2 have been inherited from sys1.

propValues2 = [sys2.TimeUnit,sys2.InputUnit]

% Copyright 2019 The MathWorks, Inc.