2011-03-08 164 views
4

我认为这将是有趣的,如果人们共享捷径(或mfiles),他们通常在Matlab中使用,以提高他们的生产力。MATLAB快捷方式

下面是我的一些:

% Shortcut 1 
clear all 
close all 
clc 
try 
    dbquit('all') 
end 

% Shortcut 2 - Show complexity of current m-file 
mlint(editorservices.getActive().Filename,'-cyc','-id') 

% Shortcut 3 - Start debugging 
dbstop if error 
dbstop if caught error 
dbstop if warning 

% Shortcut 4 - Stop debugging 
dbclear if error 
dbclear if caught error 
dbclear if warning 

我也使用测试,使快捷方式,但它们是针对我的代码。

+4

你应该把这个问题社会的维基,或者人们将其关闭。 – Lucas

+0

这应该是一个社区维基。 –

回答

1

快捷方式主要的Git仓库:

InitDirectory = cd; 
cd(GitFolder); 
dos('"C:\Program Files (x86)\Git\bin\wish.exe" "C:/Program Files (x86)/Git/libexec/git-core/git-gui" &'); 
cd(InitDirectory); 
3

下面是我的一些:

% Tidy up 
close all hidden force % Those figures WILL go away 
clear variables % Better than clear all, which removes more than just variables 
home % Better than clc - you can still scroll up to see history 
pack 

% Open Explorer in the current directory 
winopen(pwd) 

% Open a DOS prompt in the current directory 
!start 

% Open a new file in the editor, with copyright line (needs a recent version) 
newFunctionName = 'newfunction'; 
text = sprintf('function %s\n\n%% Copyright %s Company Name.\n\n',... 
    newFunctionName, datestr(now,'YYYY')); 
newDoc = matlab.desktop.editor.newDocument(text); 
+0

为什么?包之后会删除文件。 –