I have a simulation environment in Simulink, in which I have some ECU code (written in C), wrapped in an S-function, that is connected to a vehicle plant model. In this C code, I have global variables that are there for logging purposes.
How do I get Simulink to dump all global variables within this S-function to the Matlab workspace, where I can then plot variables against sim time, to confirm ECU controls?