matlab - Simulink: What happens when subsystems are initialized? -
i've been having lot of trouble getting simulink's block callbacks run, , documentation woefully inadequate , disorganized. seems i'm misunderstanding multiple points of how simulink compiles models, since stackoverflow dislikes multi-part questions, post them 1 @ time.
the situation: have library of components, each of virtual subsystem parameters defined through masks. block a
has parameter a
sent base workspace using 'assignin' command.
next, block b
has parameter b
initialized in initialization tab of mask.
finally, startfcn callback of block b
runs script needs reference both a
, b
calculate c
. in script, reference a
a
because it's in 'base' workspace, , reference b
using get_param(gcb,'b')
.
now, last command works when parameter b
user input (so it's constant value). in case, b
calculated using other parameters in initialization tab. , reason, in script, parameter zero.
i added display within block b
see these values are, , non-zero.
can please explain why script cannot seem real value of areas out of block?
you can masked workspace variable using getworkspacevariable
Comments
Post a Comment