MATLAB: In Simulink, How to obtain the -State Vector- from a -Discrete Time State Space- block

discrete timesimulinkstate observerstate-space

The Discrete Time State Space block has only one output which is logically the output of the model to its input, I know it is possible however to also obtain the state vector as part of the output and then use a combination of mux/demux to implement, say, a state observer. Can anyone help me set this up? Thanks in advance!!

Best Answer

If you want to obtain the state vector as an output from your state space model, then you have to set your C matrix like:
C=eye(n);
where n is the number of states in your state space model.
Related Question