Content of Live Scripts on Ubuntu keeps getting deleted

2 Ansichten (letzte 30 Tage)
Riste Karashabanov
Riste Karashabanov am 4 Mai 2021
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 Kommentar
David Apolo
David Apolo am 10 Nov. 2021
I have the exact same problem. Matlab 2020b running on Ubuntu 20.04 LTS

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Walter Roberson
Walter Roberson am 10 Nov. 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.

Sai Sumanth Korthiwada
Sai Sumanth Korthiwada am 1 Nov. 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:
  1. export/save to HTML rather than PDF. If PDF is required, then you can save/print the generated HTML to PDF.
  2. 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.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by