samer@4: % general - Add subdirectories of general to path samer@4: % samer@4: % general :: cells { string } => void. samer@4: % samer@4: % Use general('all') or samer@4: % >> general all samer@4: % To add all subdirs to path. samer@4: % samer@4: % Available subdirectories are: samer@4: % algo - Algorithms and APIs samer@4: % arrutils - General array manipulations samer@4: % cellutils - Cell manipulations samer@4: % fileutils - File handling samer@4: % funutils - Functional programming samer@4: % numerical - Numerical analysis (inc scalar, vector, matrix) samer@4: % discretise - Discretisation and quantisation tools samer@4: samer@4: function general(dirs) samer@4: if nargin<1, samer@4: disp('Type >> general all to add all subdirectories to matlab path'); samer@4: return; samer@4: end samer@4: samer@4: if strcmp(dirs,'all') samer@16: dirs={'algo','arrutils','cellutils','fileutils','funutils','discretise', ... samer@16: 'numerical','numerical/scalar','numerical/array','numerical/matrix'}; samer@4: end samer@4: thisfile=which('general'); samer@4: seps=strfind(thisfile,filesep); samer@4: thisdir=thisfile(1:seps(end)); samer@4: for i=1:length(dirs) samer@4: addpath([thisdir,dirs{i}]); samer@4: end samer@4: end samer@4: