Home > utils > listFilesOfType.m

listFilesOfType

PURPOSE ^

Returns directory listing of all files in diretory specified by fpath of

SYNOPSIS ^

function flist = listFilesOfType(fpath,ftypes)

DESCRIPTION ^

 Returns directory listing of all files in diretory specified by fpath of
 one of the types specified in cell-array ftypes

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function flist = listFilesOfType(fpath,ftypes)
0002 % Returns directory listing of all files in diretory specified by fpath of
0003 % one of the types specified in cell-array ftypes
0004 
0005 % 27Oct2011 PJ
0006 
0007 ntypes = length(ftypes);
0008 
0009 flist = {};
0010 for itype = 1:ntypes
0011     tmplist = dir(fullfile(fpath,sprintf('*.%s',ftypes{itype})));
0012     
0013     flist = [flist {tmplist(:).name}];
0014     
0015 end % for itype
0016 
0017 return

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003