How do I convert MATLAB file to PDF file?

2,677 次查看(过去 30 天)
I write code in MATLAB. Now, I want to convert PDF, DOC or DOCX. How can I do this?
  2 个评论
MIN
MIN 2023-10-28
移动:Rik 2023-10-29
I don't want to include picture....how can I do that?

请先登录,再进行评论。

采纳的回答

Cris LaPierre
Cris LaPierre 2024-10-21,0:00
编辑:MathWorks Support Team 2024-10-21,18:17
To convert a live script to PDF, go to the Live Editor tab and select Export > Export to PDF. For more information, see Ways to Share and Export Live Scripts and Functions. Alternatively, you can use the "export" function.  
For example: 
export("myfile.mlx")
To convert a script to PDF, on the Publish tab, select Publish > Edit Publishing Options. Then, set the Output file format to pdf. For more information, see Publish and Share MATLAB Code. Alternatively, you can use the "publish" function.  
For example:  
publish("myfile.m","pdf");
  3 个评论
Arujan Rajadurai
Arujan Rajadurai 2020-10-10
How about if I'm just using a script (not live), is there a way to print my script as a pdf?
Thank you!
Cris LaPierre
Cris LaPierre 2020-10-10
编辑:Cris LaPierre 2020-10-10
Use the publish function.
publish('script.m','pdf')
You should also see a Publish tab when viewing a *.m script in the editor. Follow these steps to use a graphical approach.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Live Scripts and Functions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by