Simulink constant parameter read inside Matlab Function block

Hi. I defined some Simulink parameters to the Model Workspace of a Simulink model. When used in a Constant block, the code compiles with no error. When used in a Matlab Function block, I get the 'undefined variable' error.
How can I use global parameters in the Matlab Function block, without having to add an input port for each parameter?
Thanks

댓글 수: 3

your version of Matlab?
how many parameters do you have? their size?
River Rock
River Rock 2012년 10월 12일
편집: River Rock 2012년 10월 12일
Matlab R2012a 6 parameters, all scalar (i left data type auto)

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

 채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 10월 12일

0 개 추천

My answer to this previous question should work for you.

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 12일
편집: Azzi Abdelmalek 2012년 10월 12일
If you have sevral parameters with the same size , you can use one constant block with value
[param1 param2 ... paramn]

카테고리

도움말 센터 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by