How do I save the output from a live script without saving the code?
古いコメントを表示
Hello!
I have a matlab live script that includes snippets of code - but I'd like to save the results of the live script without saving the code. Is this possible?
回答 (2 件)
Trang Cao
2023 年 4 月 24 日
2 投票
I had the same question and then figured out the answer.
- Go to View tab, choose Hide code
- Go to Live Editor tab, export to PDF.
Priyank Sharma
2018 年 4 月 3 日
0 投票
My understanding is that you are trying to save the output to the base work space. If that is so, you can use the eval function to do the work for you. There is no need to save the script.
4 件のコメント
Serge Boisse
2018 年 10 月 30 日
編集済み: Serge Boisse
2018 年 10 月 30 日
Hello Pryank,
I think what Sohaib Ahmad wants is to save (in PDF) the formatted text, the equations, the images, and output from calculations (including plots), but not the code and the functions themselves.
For instance, there could be an option added to the "save as PDF" menu like "with / without code included"
This would be a very useful feature to prepare technical documents for non-matlab users.
I would really appreciate if it existed, but, alas, as far as I know, it doesn't. Or am I wrong ? Is it pro grammatically possible ?
The only suggestion i have is to save as html, then edit the html to remove codes snippets, and use an html to pdf converter.
Or duplicate the .mlx file, run it, and edit it to remove the code (without re-running it !) but i'm afraid "save as.." will re-run everything
Walter Roberson
2018 年 10 月 30 日
Perhaps use publish()?
Serge Boisse
2018 年 10 月 31 日
編集済み: Serge Boisse
2018 年 10 月 31 日
Yes! publish() is exactly what i meant. Have a look at "publish" and also "Output Preferences for Publishing" in the documentation. There is an "include code" option, so this is nice.
However, the "publish" tab is only available when you open a .m document, not .mlx So you need to save first your live script as .m, load the .m and publish it to pdf.
Stephen23
2018 年 10 月 31 日
@Serge Boisse: you should put that as an answer.
カテゴリ
ヘルプ センター および File Exchange で Scripts についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!