Content of Live Scripts on Ubuntu keeps getting deleted
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Riste Karashabanov
el 4 de Mayo de 2021
Respondida: Sai Sumanth Korthiwada
el 1 de Nov. de 2022
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 comentario
David Apolo
el 10 de Nov. de 2021
I have the exact same problem. Matlab 2020b running on Ubuntu 20.04 LTS
Respuestas (2)
Walter Roberson
el 10 de Nov. de 2021
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.
1 comentario
Sai Sumanth Korthiwada
el 1 de Nov. de 2022
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 comentarios
Ver también
Categorías
Más información sobre File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!