Save Live Script automatically as PDF
古いコメントを表示
Hello everyone,
I have a problem!
I wrote a program for the calculation of test data in the App Designer. The test results of the test person should be given to them in a report. Since I do not have access to the report generator, I have compiled the results in a live script and output them. I have set the button on the right to "hide code" and to save I press "save" and then "export to pdf".
Since I would like to compile the program as a standalone program, I cannot press the buttons myself and save the live script as a PDF.
I already tried the following:
matlab.internal.liveeditor.executeAndSave (which ('Handout.mlx'));
matlab.internal.liveeditor.openAndConvert ('Handout.mlx', 'test.pdf');
Unfortunately, the code is always displayed there! But the design fits :-)
Is there another way to automatically save the LiveScript as PDF without code?
採用された回答
その他の回答 (2 件)
Sahithi Kanumarlapudi
2020 年 11 月 18 日
0 投票
Hi,
From your question I understand that you would like to store the output of a live script without the code. If that is what you are intending to do you can use the 'publish()' function to view the output in html format.
You can refer to the below link to find more info and examples on how to use publish function
Hope this helps!
Pierre Harouimi
2023 年 4 月 3 日
pdffile = export("myscript.mlx","myconvertedpdffile.pdf")
2 件のコメント
Mukesh
2024 年 8 月 26 日
export from within the mlx file doesn't save/export the latest run output..
it is very frustrating.
Pierre Harouimi
2024 年 8 月 26 日
It is possible to save the latest run, by using:
currentDoc = matlab.desktop.editor.getActive;
currentDoc.save;
% And then hide the code if you want
export(matlab.desktop.editor.getActiveFilename,HideCode=true)
However, I wouldn't use neither save neither export within the file, except you don't have any other solution.
I'd use:
matlab.internal.liveeditor.executeAndSave('filename.mlx')
export('filename.mlx')
カテゴリ
ヘルプ センター および File Exchange で Scripts についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!