Is it possible to programmatically run and export a live function in MATLAB Version R2020a? I know in version 2022 you can use the export function.
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Joe Lettieri
le 7 Juin 2022
Modifié(e) : Stefanie Schwarz
le 20 Sep 2024
I know that in Matlab 2022, you can use the function
export("MyLiveScript.mlx");
to export a Live Script or Function. But this doesn't work in Version 2020. Is there any work around, other than just clicking the menu bar?
0 commentaires
Réponse acceptée
Chandrika
le 9 Juin 2022
As per my understanding, you want to programatically execute and export a livescript. For MATLAB version R2020a, please look at the following commands as a possible workaround solution to run and export live function- MyLiveScript.mlx
mlxloc = fullfile(pwd,'\MyLiveScript.mlx');
fileout = fullfile(pwd,'\test.docx');
matlab.internal.liveeditor.executeAndSave(mlxloc);
matlab.internal.liveeditor.openAndConvert(mlxloc,fileout);
It shall convert the live script to a docx file and save it in the current folder. To save the output file, you can here use file extensions as per your convenience.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Simulink Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!