Why does my Constant block not accept a structure's field as input?

조회 수: 6 (최근 30일)
In the base workspace I have defined the following:
k = mpt.Parameter;
k.Value = 7;
h.k = k;
If I now try to use this structure in the value field for my Constant block I receive the following error:
Expression 'h.k' for block 'testmodel/Constant' returns a Simulink.Parameter object that has property values that need to be evaluated. This object should be instantiated in a workspace and referenced by name in Simulink.
Why?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
The manner in which you are trying to use a Simulink.Parameter object has been no longer possible since Simulink 6.3 (R14SP3). More information about this can be found in the Simulink release notes for this release:
<http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/rn/bqmg7gc-1.html#bqmn6zb-1>
Please refer to the section named "Parameter Object Expressions No Longer Supported in Dialog Boxes".
If you have installed the help documentation, you may access the same page locally by typing the following at the MATLAB prompt:
web([docroot,'/toolbox/simulink/rn/bqmg7gc-1.html#bqmn6zb-1'])
The only possibility you have is to use Simulink.Parameter objects that are defined in the workspace and that can be referenced directly and not as result of an expression. There are no workarounds.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Model Editing에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2007b

Community Treasure Hunt

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

Start Hunting!

Translated by