loadallfiles.m

来自「时间序列分析的信号处理MATLAB工具包」· M 代码 · 共 44 行

M
44
字号
function [status,datafiles] = loadallfiles(cwd, filter)% tstool/loadallfiles%% % load all filenames with extensions matching filter in current directory cwd% the names are inserted into the tstool file listif ((cwd(end) == '/') | (cwd(end) == '\')) & (length(cwd) > 1)	cwd = cwd(end-1);enddatafiles={};status=0;found = 0;d = dir(cwd);cwd = fileparts(cwd);for i=1:length(d)	filename = d(i).name;	[path,name,ext,ver] = fileparts(filename);	if strcmp(cwd, '.')		fullname = filename;		% keine laestigen Punkte vor Files im lokalen Verzeichnis	else		fullname = fullfile(cwd,[name ext]);	      end	if strcmp(filter, ext) | isempty(filter)	  if exist(fullname, 'file')	    disp(['Load ' fullname]);	    [status,datafiles]=writelevel(fullname,datafiles);	    if status == 0	      found = found + 1;	    end	  end	endendif found == 0	status = 'no matching files found';else	status = 0; 	% OKend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?