Asked by ABU BAKAR TALHA
on 18 Sep 2019

I am trying to learn MATLAB and i came across a command lsim and i opened its help and from there i get code and tried to simulate that code in my MATLAB . I get two plots in final output figure but i am confused why it gives two plots in final output figure despite the fact that each subplot contains two waveforms??what is the difference between these two subplots as shown in attachment?? What is above plot showing and what is its meaning?? and what bottom plot showing and its meaning??

More Answers in the Power Electronics Community

Answer by Star Strider
on 18 Sep 2019

Edited by Star Strider
on 18 Sep 2019

Accepted Answer

Star Strider
on 18 Sep 2019

Both systems are ‘H’. It is a SIMO system, since the ‘B’ matrix is a vector, so the same input is presented to both systems. A MIMO system (as depicted in Control Systems/MIMO Systems) has separate inputs for each system, controlled by the structure of the ‘B’ matrix.

To see this most easily, convert it to state space, then repeat the lsim call:

H = [tf([2 5 1],[1 2 3]);tf([1 -1],[1 1 5])];

S = ss(H)

[u,t] = gensig('square',4,10,0.1);

lsim(S,u,t)

You will see that ‘S’ is:

S =

A =

x1 x2 x3 x4

x1 -2 -1.5 0 0

x2 2 0 0 0

x3 0 0 -1 -2.5

x4 0 0 2 0

B =

u1

x1 2

x2 0

x3 1

x4 0

C =

x1 x2 x3 x4

y1 0.5 -1.25 0 0

y2 0 0 1 -0.5

D =

u1

y1 2

y2 0

Continuous-time state-space model.

The lsim output is the same as before.

ABU BAKAR TALHA
on 18 Sep 2019

Are you calling/denoting/meaning numerator of H as one system and denominator H as second system??

Star Strider
on 18 Sep 2019

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 1 Comment

## KALYAN ACHARJYA (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/480934-difference-between-two-plots-of-this-final-output-figure#comment_747230

Sign in to comment.