"Hidden" variables after running Simulink model with Matlab function

1 次查看(过去 30 天)
I'm working with a Simulink model that uses a Matlab function saved in m-file. The function is called during simulation with the help of the "Interpreted Matlab function" block. I noticed, that after the first simulation, the second simulation has non-default (non-zero/non start-up) initial values for the variables, which are used in the Matlab function. These values correspond to the final values of the first simulation. So somehow the variables are saved somewhere inside of Matlab, but not seen in the Workspace. These variables are local to the m-file function, i.e. no additional statements like persistent or global are used for them. I also found out, that if I execute the clear('functions') command before running the second simulation, the Simulink model uses then the default (zero/start-up) variables. How can I see those "hidden" variables and how can I clear them without using clear('functions') command? This command also clears all breakpoints, what I don't like.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by