필터 지우기
필터 지우기

what does Simulink.B​lockdiagra​m.getIniti​alState do

조회 수: 3 (최근 30일)
Hongkai Dai
Hongkai Dai 2011년 7월 29일
I build a simulink block, and to run it, I use Simulink.BlockDiagram.getInitialState(getModel(obj)), but it keeps telling me some error:
Caused by: Error using ==> getInitialState at 24 Index exceeds matrix dimensions.
It is a C MEX function, I do not know how to dig into the code. Does anyone know what the error message means?

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 7월 29일
Simulink.BlockDiagram.getInitialState is a p-coded function, so you cannot look into it. However, the way you are calling it makes me suspicious about what getModel(obj) returns. Note that the input to Simulink.BlockDiagram.getInitialState must be a string containing the model's name (without the .mdl extension). So perhaps this is just a syntax error.
  댓글 수: 2
Hongkai Dai
Hongkai Dai 2011년 7월 29일
Thanks for your help! But getModel just returns me a string of the model name, without .mdl. So I guess this is not the reason. I guess the reason is the incompatibility of the state, as it says "Index exceeds matrix dimensions", but I am not sure where that comes from.
Kaustubha Govind
Kaustubha Govind 2011년 7월 31일
Are you able to update and run the model successfully, or are there any errors?

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

카테고리

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