필터 지우기
필터 지우기

Warning: Editor is not serializable

조회 수: 4 (최근 30일)
Abdulllah
Abdulllah 2019년 8월 4일
답변: Masudur Siddiquee 2019년 10월 22일
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.

채택된 답변

Masudur Siddiquee
Masudur Siddiquee 2019년 10월 22일
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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2019년 8월 4일
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.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by