How do I convert MATLAB file to PDF file?
Show older comments
I write code in MATLAB. Now, I want to convert PDF, DOC or DOCX. How can I do this?
4 Comments
madhan ravi
on 29 Mar 2020
You maybe looking for publish()
doc publish
Colin
on 10 Feb 2025
What a nightmare. A person wants to print a script file as pdf -- no fancy headers, table of contents, bold comments, figures. MathWorks can't even explain how to do that!
Cris LaPierre
on 10 Feb 2025
Edited: Cris LaPierre
on 10 Feb 2025
There are 2 options described below. Not sure why those options don't work for you, but if you just want to print to pdf, click the print icon in the EDITOR tab ('Live Editor' tab if working with mlx file). The appearance may depend on your version of MATLAB, and whether it is an *.mlx or *.m file.

You'll get a print dialog where you can set your printer to be a PDF printer.


Accepted Answer
More Answers (0)
Categories
Find more on Scripts in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!