Process all file in a folder by function

3 ビュー (過去 30 日間)
Geppo Batt
Geppo Batt 2012 年 5 月 11 日
Hi, i write a function which process a image file : main(filename) where "filename" indicates the image to be process. I would like to process all the images in the folder "tot16", i would use this function <http://www.mathworks.com/matlabcentral/fileexchange/25316-auto-process-all-files-in-sub-folders&watching=25316> but not working. I write the function call :
PathRunner('/Users/XXXX/Documents/MATLAB/Thesis' , '/tot16' ,@main , flag , '*.raw' )
where :
  • /Users/XXXX/Documents/MATLAB/Thesis is the directory where is the function @main
  • /tot16 is the directory which contain all image files
  2 件のコメント
Jan
Jan 2012 年 5 月 11 日
Please explain, what "not working" exactly means.
Geppo Batt
Geppo Batt 2012 年 5 月 11 日
Cell contents reference from a non-cell array object.
Error in cell2mat (line 37)
if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1})
Error in PathRunner (line 66)
list_of_files = [list_of_files dir([current_folder
cell2mat(file_type(ft))])]; %file names

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2012 年 5 月 11 日
The file type parameter must be given to the function as a cell array of strings, even when you are only passing in a single file type string.
{'*.raw'}
  1 件のコメント
Geppo Batt
Geppo Batt 2012 年 5 月 11 日
Error using fopen
First input must be a file name of type char, or a file identifier of type double.
Error in main (line 14)
fid = fopen(filename,'rb');
Error in PathRunner (line 92)
feval(function_to_run , file_info);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by