assignin function does not work from export function
5 次查看(过去 30 天)
显示 更早的评论
Hello.
We're using the export function to run an *.mlx file and then export it to a pdf.
I don't seem to be able to interact with the OS filesystem or store data in the base workspace when the *.mlx is executed using the export function
export("Analyse_Template",filename,PageSize="A4",Run=true,FigureResolution=800,HideCode=true);
% using assignin does not work
assignin('base','OutPutTable',OutPutTable)
% using writetable does not work
writetable(inputTable, FName,"WriteMode","append");
Executing the *.mlx file itself produces the desired results.
Why can I not work outside of the scope of the export function?
Many thanks in advance.
0 个评论
回答(1 个)
arushi
2024-8-16
Hi Tobias Panitz
I encountered a similar issue when using the live script, but when I ran the code in a “.m” file instead of “. mlx” file, it executed just fine.
Hope this helps.
2 个评论
Walter Roberson
2024-8-19
That just might work. When you invoke a .mlx from inside a .m, the matlab part of the code gets extracted from the mlx and then executed. This is different than how .mlx are executed normally.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!