Running a function on several files in Matlab -


possible duplicate:
how run same code many files(different file name in same directory) in matlab?

i have written function definition:

function deleteempty(filename) 

normally when want execute function, in command window type:

>> deleteempty('c:\documents , settings\matlab\**myfile**.xls') 

however, have many files need run through function. mean need copy , paste filename , execute function each time?

is there faster way or code process files?

here convenient solution call function on several files:

%# build list of file names absolute path fpath = uigetdir('.', 'select directory containing xls files'); if fpath==0, error('no folder selected'), end fnames = dir( fullfile(fpath,'*.xls') ); fnames = strcat(fpath, filesep, {fnames.name});  %# process each file i=1:length(fnames)     out = deleteempty(fnames{i}); end 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -