Can I save / preserve list of scripts open in the editor?

10 ビュー (過去 30 日間)
Omar Mian
Omar Mian 2011 年 9 月 14 日
回答済み: Image Analyst 2020 年 11 月 12 日
I am working with some data and have about 8 scripts open in the editor to enable me to do this. Is it possible to save the identity of the scripts that are open so I don't have to manually locate and open each one next time I need to work with this data set?
In other words, can I save a playlist of scripts?

採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 9 月 14 日
What is your MATLAB version? New versions might help you.
help matlab.desktop.editor
  2 件のコメント
Omar Mian
Omar Mian 2011 年 9 月 14 日
Thanks. I use 2010b and the save state script in the link provided doesn't work for me. I'll upgrade to the latest version when I get a chance.
Jan
Jan 2017 年 11 月 11 日
The link is dead.

サインインしてコメントする。

その他の回答 (2 件)

Image Analyst
Image Analyst 2020 年 11 月 12 日
To get a list of all filenames that are open in the editor, you can do this:
% Get list of all script editor tabs, listing names of the files in the command window.
editorTabs = matlab.desktop.editor.getAll;
% Filenames seem to be ordered in the editorTabs list by when you opened them:
% longest ago = #1, and most recently opened is the last item on the editorTab list.
% for k = length(editorTabs) : -1 : 1 % Use this to see them in reverse order: most recent to oldest.
for k = 1 : length(editorTabs) % Use this to see them in original order: oldest to most recent.
fprintf('(#%2d of %2d) Filname of editorTab(%d) =\t%s. \n', k, length(editorTabs), k, editorTabs(k).Filename);
end
I'm also attaching some utilities to close them with and without prompting.

Sean de Wolski
Sean de Wolski 2011 年 9 月 14 日
Sure:
make a new script that calls:
edit script1
edit script2
edit script3
%etc.
it'll open all of 'em.
You might also want to look at cell mode and then concatenate them into one script but in different cells of that script. You can then evaluate each one independently but they'll all be together.
  2 件のコメント
Omar Mian
Omar Mian 2011 年 9 月 14 日
Thanks. Do you know if there a function that can be used to build a list of current scripts in the editor (other than the one mentioned in the link provided by Fangjun Jiang, which seems to require a newer version of matlab)?
Sean de Wolski
Sean de Wolski 2011 年 9 月 14 日
Not to my knowledge.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by