Tabbing between opened Editor tabs
显示 更早的评论
Greetings Matlab community,
When using Matlab I usually have several tabs opened in the 'Editor' tab, and often I require to shift between different tabs to look up existing code or compare scripts.
I was wondering if there exists any kind of keyboard shortcut to do so - similarly to cycling through open tabs with 'ctrl+tab' in a browser like Firefox - or if I'm required to actively click my mouse or type in the command window every time?
I look forward to reading your input.
Best regards, Thomas
采纳的回答
更多回答(1 个)
Paulo Silva
2011-2-26
I was curious about the question because I always have many open mfiles at the same time in matlab 2008b and the tab navigation is horrible, I didn't knew at the time those shortcuts that Jiro posted so here's a simple GUI that lists the m files currently open in a table and you can select the one you want just by clicking on the name.
function MFileSelector
fig=figure;set(fig,'MenuBar','none');
set(fig,'Name','MFileSelector by Paulo Silva');
set(fig,'NumberTitle','off');
file=com.mathworks.mlservices.MLEditorServices.builtinGetOpenDocumentNames;
out=char(file);
dat=cellstr(out);
rownames=1:size(out,1);
try rownames=cellstr(rownames),catch,end
columnname={['Here''s a list of the matlab open Mfiles'...
',you can select the one you want to edit by clicking on it']};
columnformat = {'char'};
columneditable = [false];
mytable = uitable('Units','normalized','Position',...
[0 0 1 1], 'Data', dat,...
'ColumnName', columnname,...
'ColumnFormat', columnformat,...
'ColumnEditable', columneditable,...
'RowName',rownames);
set(mytable,'ColumnWidth','auto')
%set(mytable,'KeyPressFcn',@selectedfile)
%set(mytable,'ButtonDownFcn',@selectedfile)
set(mytable,'CellSelectionCallback',@selectedfile)
function selectedfile(a,eventdata)
selcell=eventdata.Indices;
edit(out(selcell(1),:));
delete(fig);
end
end
类别
在 帮助中心 和 File Exchange 中查找有关 Scripts 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!