Programmatically run and export live script
43 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Joachim Vandekerckhove
el 6 de Mayo de 2016
I have a set of live scripts that I can save as html and publish for a client to inspect. Right now, I do that by opening one script at a time, hitting F5, and then clicking Save As >> html to save it. I'd like to automate that process. I was hoping publish('script.mlx','html') would work, but it doesn't seem to. I can save the *.mlx as .m and publish that, but it changes the layout and formatting, and I'd like to keep those.
0 comentarios
Respuesta aceptada
Baptiste Ottino
el 7 de Ag. de 2017
Hi, I'm late to the party, but I spent hours and hours on this issue, and by pure luck I just found the answer. So in hope someone reads this, here is the function you are looking for. It certainly is the one called by the "Save As" button.
doc matlab.internal.richeditor.openAndConvert
Best regards.
13 comentarios
Harry van der Pol
el 9 de En. de 2022
Editada: Harry van der Pol
el 9 de En. de 2022
As an addition to the answer of Jesse Desterro
In stead of using strcat, use the function fullfile to make the script run as well on Window like systems as on Unix systems. So instead of
mlxloc = strcat(pwd,'\filename.mlx');
use
mlxloc = fullfile(pwd,'filename.mlx');
Ver también
Categorías
Más información sobre Live Scripts and Functions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!