


genThumbNail2: 適用於2層目錄
例如:genThumbNail2('C:\Documents and Settings\user\桌面\gourami\photo\2005')

0001 function genThumbNail2(yearDir) 0002 % genThumbNail2: 適用於2層目錄 0003 % 例如:genThumbNail2('C:\Documents and Settings\user\桌面\gourami\photo\2005') 0004 0005 if nargin<1; yearDir='C:\Documents and Settings\user\桌面\gourami\photo\'; end 0006 if yearDir(end)=='\' | yearDir(end)=='/', yearDir(end)=[]; end 0007 0008 allDates=dir(yearDir); 0009 allDates=allDates([allDates.isdir]); 0010 allDates(1:2)=[]; 0011 0012 for i=1:length(allDates) 0013 thisDate=[yearDir, '\', allDates(i).name]; 0014 fprintf('%d/%d ===========> %s\n', i, length(allDates), thisDate); 0015 genThumbNail1(thisDate); 0016 end