Dimensions of matrices being concatenated are not consistent

1 view (last 30 days)
Hello,
I am trying to add in a State-Space Block into simulink with the following matrices:
State-Space Block.jpg
However I recieve the following error whenever i try to apply this:
Error.jpg
Where am i going wrong.
  2 Comments
Geoff Hayes
Geoff Hayes on 9 Mar 2019
Matthew - which matrices are being multiplied together? A is 3x3 and B is 3x1; C is 4x3 and D is 4x1. Do your initial input need to be a 3x1 array? (I'm just guessing here...is this the x in the equations?)
Matthew Tarn
Matthew Tarn on 9 Mar 2019
Edited: Matthew Tarn on 9 Mar 2019
Thankyou in advanced for your reply.
I have calculated the matrices by hand to meet parameters for a State-Variable feedback controller on paper and would like to test my calculations in matlab/simulink.
The following is a picture of the circuit i am trying to design and input my matricies/gains into, I also have 3 pole positions determined:
I have expanded C from a 1x3 matrix to a 4x3 matrix and D from a 1x1 matrix to a 4x1 matrix; to give myself 3 more outputs instead of just 1 output from the original C and D so that when the data is output i can see part 1 on the scope and parts 2,3 and 4 can be multiplied by a gain matrix I have.
I have got the size of the matricies that i need from this information on:https://uk.mathworks.com/help/simulink/slref/statespace.html
snip.JPG
Matt

Sign in to comment.

Answers (1)

Geoff Hayes
Geoff Hayes on 9 Mar 2019
Matt - from your above description, C is an rxn matrix and D is an rxm matrix where r is the number of outputs. Doesn't this mean that your Initial Outputs must be a 4x1 array?
  2 Comments
Matthew Tarn
Matthew Tarn on 9 Mar 2019
Yes thats correct Geoff, is it as simple as putting 4*1 into the “initial outputs“ box and 1*1 into the initial inputs box?
Again, Thank you for your responses so far.
Matt

Sign in to comment.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!