Hi everyone, I have a state-space model here, which sent output u to MATLAB Function. Inside of MATLAB Function I declare Function [A,B,C,D] = input(u) and the if loop as the attached picture.
But when i run the simulation, It says invalid Matrix A in state space (I set A,B,C and D in each A,B,C,D block) Please tell me where is my mistake in my model/matlab function. Thank you in advance!!

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 7월 23일

0 개 추천

The matrices A,B,C,D of your SS model should be set inside your SS block http://www.mathworks.com/help/simulink/slref/statespace.html#zmw57dd0e133327 , you can't set them as an entry of your system. The entries of your SS block are considered as the entry signals of your system.

댓글 수: 2

Chihhan Hou
Chihhan Hou 2016년 7월 23일
편집: Chihhan Hou 2016년 7월 23일
Thank you Azzi Abdelmalek. so actually I cant connect the matlab function to the input of SS block is that you mean? In that case, If I want to change the A,B,C,D matrices in ss block as the output U change, how can i do?
You have at least two options
  1. Rewrite your state space model with other blocks like derivative, sum, etc...
  2. Or you can use set_param function outside simulink
doc set_param

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 General Applications에 대해 자세히 알아보기

제품

질문:

2016년 7월 23일

댓글:

2016년 7월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by