Save Live Script automatically as PDF
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (2)
Sahithi Kanumarlapudi
el 18 de Nov. de 2020
0 votos
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!
1 comentario
Jana Pecke
el 19 de Nov. de 2020
Pierre Harouimi
el 3 de Abr. de 2023
pdffile = export("myscript.mlx","myconvertedpdffile.pdf")
2 comentarios
Mukesh
el 26 de Ag. de 2024
export from within the mlx file doesn't save/export the latest run output..
it is very frustrating.
Pierre Harouimi
el 26 de Ag. de 2024
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')
Categorías
Más información sobre Scripts en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!