📄 getsubdirs.m
字号:
function dirlist = getsubdirs(dirname)
%GETSUBDIRS Recursively get all subdirectories of a directory
% Copyright 2003
fs = filesep;
files = dir(dirname);
subdirs = files(logical([files.isdir]));
dirlist = {dirname};
% ~strcmp(this,'..') strcmp(this(1),'h')
if ~isempty(subdirs)
for n = 1:length(subdirs)
% Short circuit directories on the stop list
this = subdirs(n).name;
if ~strcmp(this(1),'@') && ...
~strcmp(this,'.') && ...
~strcmp(this,'..')
dirlist = [dirlist; ...
getsubdirs([dirname fs this])];
% disp([dirname filesep this])
end
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -