ss function returning 1x2 ss, can't modify its values.
Show older comments
Hey there,
I downloaded a model program from Matlab (it't in the examples folder) and I tried to modify it to get it working with my own example which we've done at the university. The problem is that in the example the ss(A,B,C,D,Ts) is returning a 1x1 ss az its value, while for my inputs it gives a 1x2 ss. I get the error at the following part:
sysd.C = [eye(2); cholP]; in my case it should be = [eye(3); cholP];
sysd.D = zeros(4, 1); in my case it should be = zeros(6,2);
I get the following error: Error using InputOutputModel/subsasgn (line 57) The values of the "c" and "d" properties must be matrices with the same number of rows.
Truth is I tried every possible combination of sizes and matrix dimensions but it would not work. In the original one after the second row from the above part the 1x1 ss turns into a 4x1 ss. The difference between the two codes (mine and the mathworks one) is the dimensions. They have
Ts = 0.1;
A = [0.8 Ts;0 0.9];
B = [0;Ts];
C = [1 0];
sysd = ss(A,B,C,0,Ts);
while I have
Ts = 0.1;
A = [0.001 -4.4 -6.5;
0.039 0.07 -0.4;
0.003 0.088 0.98];
B = [0.03 1;
0.02 2;
0.01 1];
C = [10 2 -1];
D = [0 0];
sysd = ss(A,B,C,D,Ts);
Fact is that for mine, the ss() stored the first column of my B in the first ss, while the second row of B goes into the second. I have no clue why, whilst for A it can store a whole matrix in one ss.
I attached their original m file, which I would want to work for my inputs.
Answers (0)
Categories
Find more on Controller Creation 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!