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

6 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
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.

Más respuestas (0)

Categorías

Más información sobre Interactive Model Editing en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2007b

Community Treasure Hunt

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

Start Hunting!

Translated by