How can I display ans in a generated PDF?

I'm doing a MatLab project for a class, and we're supposed to generate a PDF from our m files that show the output of our code. I've tried generating a PDF, and it will display the graphs I make, but the answers to expressions don't show up. For example, in the Command Window, if I type 5*8, ans = 40 will appear. However, in the generated PDF, it would only show 5*8 without showing the output. I tried setting "Evaluate code" to true in the publishing settings, but that didn't help.
If it's relevant, I've declared some vectors and am trying to have the PDF display the results when I dot and cross them.
Any suggestions are greatly appreciated. Thank you!

 Accepted Answer

madhan ravi
madhan ravi on 6 Nov 2018
Edited: madhan ravi on 6 Nov 2018

2 Comments

I tried this by typing
publish('MatLab2','pdf')
However, the generated PDF still didn't show the results of my operations. Is there a parameter to publish that I'm missing?
'MatLab2.m'
If it doesn’t work see the links I provided

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2018b

Tags

Asked:

Jay
on 6 Nov 2018

Edited:

on 6 Nov 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!