https://kr.mathworks.com/help/simulink/slref/simulink.simulationinput.setpostsimfcn.html
setPostSimFcn - Set MATLAB function to run after each simulation - MATLAB
This MATLAB function configures the post-simulation function associated with the function handle func on the Simulink.SimulationInput object simIn.
setmatlabfunctionrunsimulation