Oct 29, 2010

Directory listing in MATLAB

For listing files in a directory

dirfullname = 'C:\Documents and Settings\';
fileFolder = fullfile(dirfullname);
dirOutput = dir(fullfile(fileFolder));
fileNames = {dirOutput.name}'


To filter files, use the second argument of fullfile function.

dirOutput = dir(fullfile(fileFolder,'*.jpg'));

No comments:

Post a Comment