From within a StopFcn callback, I need to determine if the simulation was run using the 'sim' function vs using the GUI play button.
This is because the simulation outputs are not available in the callback for the command-line simulations and I have post-processing script running in the StopFcn callback.
How can I robustly determine whether the 'sim' function was used to run the simulation?
Because I want to detect when someone calls the 'sim' function, and throw a warning or an error telling them to run using the GUI play button.
Best Answer