mydir=uigetdir('D:\Sequences\Weizmann\bend'); %displays a dialog box for the user to browse through the directory
%structure and select a directory, and returns the directory name as a string
if mydir(end)~='\'
mydir=[mydir,'\'];
end
DIRS=dir(['D:\Sequences\Weizmann\bend\','*.avi']); %扩展名 (method 1)
%DIRS=dir([mydir,'*.avi']); %扩展名 (method 2)
n=length(DIRS);
for i=1:n
if ~DIRS(i).isdir
DIRS(i).name %%%%%%%要载入,做处理,你在这里弄就可以了
%load(DIRS(i).name)
end
end