daily pastebin goal
50%
SHARE
TWEET

dirRecurse.m

davidagross Jun 10th, 2016 (edited) 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function files = dirRecurse( folder )
  2.  
  3. directories = dir( folder );
  4. directories = directories( [directories.isdir] );
  5.  
  6. files = arrayfun( @(S) S.name , dir( fullfile( folder , '*.m' ) ) , 'UniformOutput' , false );
  7.  
  8. for d = 1:numel(directories)
  9.     if ~strcmp( directories(d).name(1), '.' )
  10.         files = cat(1, files , dirRecurse( fullfile( folder , directories(d).name ) ) );
  11.     end
  12. end
RAW Paste Data
Top