Hi,
If you're unable to see the command outputs in your PDF file generated using the "publish" command, it could be due to several reasons related to the "publish" command itself or the presence of semicolons (;) in your code, which suppress output display.
Try below steps which might helpful to resolve this issue:
- Make sure that the publish settings are configured to include the output. You can do this by setting the 'showCode' and 'evalCode' options to true. Here's an example of how you might call publish with these options:
opts = struct('format', 'pdf', 'showCode', true, 'evalCode', true);
publish('your_script_name.m', opts);
- Ensure that your script is not suppressing output with semicolons (;). Outputs that are suppressed in the script won't appear in the published PDF.
- Refer the following documentation link to know more about "publish": https://www.mathworks.com/help/matlab/ref/publish.html
If you are getting infinite loops of figures, at the beginning of your script to ensure that all figures are closed before running the script. This can prevent the accumulation of figures.
I hope this helps!
