Content of Live Scripts on Ubuntu keeps getting deleted
2 次查看(过去 30 天)
显示 更早的评论
Hi everyone!
I'm using MatLab on Ubuntu. I am writing most of my reports on live scripts and exporting them as PDFs. Very often when I'm mid work, MatLab freezes for a second, and the editor of the live script goes gray (this doesn't happen to .m files). The only way I can see contents of the live script I'm working on is to close it from the editor, and open it again. However, when I open the file, it is blank, and all the progress I've done is lost.
I would really appriciate if there is a solution to this, and I am interested if somebody else has the same problem?
1 个评论
回答(2 个)
Walter Roberson
2021-11-10
Do you have some kind of cron job that is cleaning out the /tmp ?
Execution of Live Scripts involves extracting the matlab source code from the binary represention of the Live Script file, and then eval() the extracted MATLAB code. The files are extracted into a subdirectory of the MATLAB temporary directory that you can find using
tempdir()
For example at the moment on my Mac, the Livescript files go into /private/var/folders/vg/8pxp_0ps5lb0998xc85797tw0000gn/T/Editor_wlcib/ which is the Editor_wlcib subdirectory of what tempdir() shows
If something on your system is cleaning out the temporary directory, then you could have problems.
Sai Sumanth Korthiwada
2022-11-1
Hello Riste,
I understand that Live Editor is freezing in Ubuntu when exporting live scripts to PDFs.
The following workarounds could be useful when exporting:
- export/save to HTML rather than PDF. If PDF is required, then you can save/print the generated HTML to PDF.
- save the live script as a ‘.m’ file and then use the publish command to save to PDF.
This issue might be due to MATLAB not having sufficient memory available to perform the exports repeatedly.
You can also try removing 'clear' or 'close' commands in the Live Script, as these impact performance as well. For example, these functions:
>> clear all
>> close all
may cause performance issues if called repeatedly.
Hope this resolves your issue.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!