Is there a hidden workspace in Simulink other than the model workspace?

1 回表示 (過去 30 日間)
Guilherme T Silva
Guilherme T Silva 2016 年 6 月 7 日
回答済み: Guilherme T Silva 2016 年 6 月 8 日
When running a Simulink model, I get unexpected behaviors if I don't call a clear all before the execution. Strange thing is that both the base and the model workspaces are empty. What could be happening? Where else can I look for those hidden variables?
Thanks!

採用された回答

Guilherme T Silva
Guilherme T Silva 2016 年 6 月 8 日
I found out what was wrong: Simulink won't clear S-functions static memory from run to run. I'm using clear mex for that. Thanks!

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 6 月 7 日
One of things that clear all does is to clear out the parsed versions of routines (which you do not care about) along with their attached workspaces -- that is, any accumulated persistent variables, which could potentially be an issue.
  2 件のコメント
Guilherme T Silva
Guilherme T Silva 2016 年 6 月 7 日
Do you have any suggestion on how to debug this? How can I at least visualize that accumulated data?
Walter Roberson
Walter Roberson 2016 年 6 月 7 日
There is no documented way to detect persistent variables in loaded functions and examine those variables -- other than doing a text search for "persistent" and putting in breakpoints.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModel Verification についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by