Initialization block executes unexpectedly and frequently

조회 수: 3 (최근 30일)
Matt Garrett
Matt Garrett 2011년 5월 3일
I have inherited a masked subsystem with a lengthly initialization block. For some reason the initialization code executes frequently and not always when I would expect. Here are some of the events that trigger the initialization code to run:
  • when the next-level model window gets focus
  • when I move the subsystem block in the next-level model window
  • when I look under the mask
Any ideas why this would happen? It doesn't happen with subsystems I create and mask myself. They run their initialization blocks at times I would expect, like after I change mask parameters.
I cannot upload this proprietary model to a file-sharing site and I have not successfully reproduced the problem in a non-proprietary model, as discussed above.
I'm using R2010b and I don't know what version the masked subsystem was created in, but it was probably recent.
Thanks, Matt

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 5월 3일
So you have a masked subsystem block. What do you mean when you say "with a lengthly initialization block"?
Every block could have many callbacks. For your masked subsystem block or any of the blocks inside that subsystem, right click a block, select "Block Properties ...", then select the "Callbacks" tab, do you see any callback function?
The behavior you described sounds like the function callbacks are triggered based on various event.
  댓글 수: 1
Matt Garrett
Matt Garrett 2011년 5월 4일
Thanks for the help. It wasn't callbacks causing the problem. I'm actually not sure why it was happening but it has stopped now.
BTW, by "lengthy initialization block" I meant it takes long enough to execute that it's noticeable, i.e., a few seconds delay every time I performed one of the trigger actions listed above.

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

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by