Borrar filtros
Borrar filtros

How to change C and D matrices of a state-space model?

9 visualizaciones (últimos 30 días)
Dino
Dino el 26 de Mayo de 2021
Comentada: Jesús Zambrano el 27 de Mayo de 2021
Hi,
I created a state-space model with the Simulink Linearization Manager and would like to derive a model with fewer outputs. So far, however, my approaches have only led to errors:
A = eye(3);
B = ones(3,1);
C = [1 0 0; 0 1 0];
D = [0; 0];
sys1 = ss(A, B, C, D, ...
'StateName', {'S1', 'S2', 'S3'}, ...
'OutputName', {'O1', 'O2'});
sys2_C = [1 0 0];
sys2_D = 0;
sys2 = sys1;
%sys2.C = sys2_C;
% Error: The "C" and "D" matrices must have the same number of rows.
sys2 = ss(A, B, sys2_C, sys2_D, sys1);
% Error: Property "OutputName" must specify one name per output channel.
Is there an elegant way to create sys2 while keeping the properties (such as StateName) of sys1?

Respuesta aceptada

Jesús Zambrano
Jesús Zambrano el 26 de Mayo de 2021
What about:
sys2 = ss(A, B, sys2_C, sys2_D, 'StateName', sys1.StateName)
  2 comentarios
Dino
Dino el 27 de Mayo de 2021
Sure, this way is fine for the given example. However, if more fields are set (StatePath, StateUnit, Ts, InputName etc.), it would become a bit messy. So I think I should wrap the whole thing into a function.
Jesús Zambrano
Jesús Zambrano el 27 de Mayo de 2021
sure, and get access to all the elements of sys1.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Robust Control Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by