Warning: Editor is not serializable
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Abdulllah
il 4 Ago 2019
Risposto: Masudur Siddiquee
il 22 Ott 2019
I run the following code to get current state of Editor
X = matlab.desktop.editor.getAll;
Then I save the variable X.
I get following warning
Warning: com.mathworks.mde.editor.MatlabEditor@73877e19 is not serializable
and X variable is saved with properties having no values.
How can I save X variable with values.
0 Commenti
Risposta accettata
Masudur Siddiquee
il 22 Ott 2019
you may automate this using the following simple script:
x=matlab.desktop.editor.getAll;
theScriptList={};
for i=1:1:size(x,2)
theScriptList=[theScriptList; {x(1,i).Filename} {x(1,i).Text}];
% suppose you want to save these 2 items
end
clearvars -except theScriptList
% now save the workspace
0 Commenti
Più risposte (1)
Walter Roberson
il 4 Ago 2019
You cannot. The editor state refers to a number of dynamic Java objects, some of which have no ability to save and restore. For example some of them refer to Windows HWND which are transient data structures with internal resource pointers.
0 Commenti
Vedere anche
Categorie
Scopri di più su Environment and Settings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!