Dynamic icon drawing in Simulink masked subsystem is not working...

How to draw an icon in a Simulink masked subsystem based on scope output to the workspace? I used to run a Simulink model twice and get an icon with a plot of the results of a simulated system that was saved in the workspace. But this doesn't work anymore! For example: Simulates G(s)=1/(s+1) as a masked subsystem that encloses G(s)and a scope. Set the scope parameters history to output data to workspace (after a simulation run!). Scope->save data to workspace-> x In the masked subsystem an icon is drawn as: plot(x.time,x.signals.values) In the first run question marks (???) appeared in the block icon, but after the model was simulated, the workspace variables were instantiated and then in a second run the icons displayed the previous results. In that way someone can display a set of results as icons in the Simulink window itself. This used to work in R2009a but is not working anymore in R2011a. What have changed, or what can I do to return to the previous nice behaviour?

Risposte (1)

It looks like some error is occurring in one or more of the drawing commands. You could try running the commands like the PLOT command you mentioned from the MATLAB prompt. You should see the variable "x" in the workspace after the first run.

3 Commenti

Hi, thanks for your attention.
After the first run, the variable x is in the workspace. The command
>> plot(x.time,x.signals.values)
plots a nice figure. This is the same code inserted in the Icon&Mask tab.
The error after any simulation run is...
Warning: Could not evaluate MaskDisplay commands of block 'icon_draw_test/Subsystem':
Undefined variable "x" or class "x.time".
This very same file used to work before. Is there any new default configuration that might prevent the Simulink from getting the variable from workspace after the first run reported an error?
Hmm.. strange case - so you're saying that the exact same model works in R2009a - you didn't add any other subsystem layers around it in R2011a?
i have the same probelm "Warning: Could not evaluate MaskDisplay commands of block"

Accedi per commentare.

Categorie

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by