Info

This question is closed. Reopen it to edit or answer.

Write a corresponding Simulink program to numerically simulate the system. Provide a screenshot of your block diagram.

1 view (last 30 days)
I am trying to use the Simulink State Space block to display my equations. I am unable how to display both my outputs in a scope. I keep getting an error that my inputs and output dimensions don't match. I only have one input, but two outputs. Any help would be appreciated. Attached below are the my matricies and my simulink attempt.

Answers (1)

Rhea Chandy
Rhea Chandy on 16 Oct 2020
It seems that you are having difficulty getting the correct input and output dimensions for your state-space system model. In the case of a linear state-space system model, u is the input vector,y  is the output vector, whilex  is the state vector. The block has one input and output port, corresponding respectively to u and y vectors. The dimensions of which depend on the dimensions of the A, B, C, and D matrices.
Input signal depends on the number of columns in B and D matrices, in your case it is 1 column. Further, Output signal depends on number of rows in C and D matrices, in your case it is 1 row.
I noticed that in the Simulink model you have shared, you have not included an input source for the vector u. This can be done using an Inport Block as shown in the image I’ve attached.
For the output signal, you can use an Outport Block, or a Scope Block as you have done. If you need to, you can display more than one signal using the scope block by changing the number of input ports.
Further, answering the question you listed in the title, you can use the ss Function to create a states-space model object.

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!