More specifically, I would like to automatically clear the workspace and all functions before a Simulink simulation starts. Is this possible? Are there hooks where I can define functions to be called before and, say, after each simulation?
More specifically, I would like to automatically clear the workspace and all functions before
Share
You can do this using model callbacks.
You can set callbacks programmatically as described on the linked page, or just right-click on an empty spot in your model file, select Model Properties, then the Callbacks tab and enter the name of the function to be called after selecting the appropriate callback in the left pane.
In your case, the
StartFcncallback seems appropriate.