- Ensure you're using “disp” or “fprintf” to print messages and follow it with “drawnow” to force MATLAB to update the Command Window immediately.
- Run your simulation in “Normal mode”. Other modes like Accelerator or Rapid Accelerator may not execute MATLAB code in real-time.
- Ensure your print statements are within the “Outputs” or “Update” functions of the S-Function, as these are called during each simulation step.
- If you want to capture all printed output to a file for review, use the “diary” function.
- https://www.mathworks.com/help/matlab/ref/drawnow.html
- https://www.mathworks.com/help/matlab/ref/diary.html