필터 지우기
필터 지우기

How to get state vector from the State-space block in Simulink?

조회 수: 35 (최근 30일)
Amine
Amine 2015년 5월 25일
댓글: Amine 2015년 5월 25일
Hello! I have a state-space block in Simulink and I want to extract the state vector in order to visualize it on scope. Is there any way to do this? Thanks!

채택된 답변

Sebastian Castro
Sebastian Castro 2015년 5월 25일
I don't believe there's a direct way to access the states unless you re-implement the state-space block yourself with matrix multiplications, integrators, etc.
What you could do expand your C matrix to include the identity matrix. Then, you can use a Selector block to break the output into output and states.
For example, say you had a 2-state, 1-output system with C = [2 1]. You could change the C matrix to be [2 1;1 0;0 1] (you'd have to also reshape your D matrix). Then, the 1st element would be your original output and the 2nd and 3rd elements would be your actual state values.
- Sebastian
  댓글 수: 1
Amine
Amine 2015년 5월 25일
Thank you so much sir! The first suggestion was much easier! Thanks again!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by