Mercurial > hg > ishara
diff general/general.m @ 4:e44f49929e56
Adding reorganised general toolbox, now in several subdirectories.
author | samer |
---|---|
date | Sat, 12 Jan 2013 19:21:22 +0000 |
parents | |
children | db7f4afd27c5 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/general/general.m Sat Jan 12 19:21:22 2013 +0000 @@ -0,0 +1,34 @@ +% general - Add subdirectories of general to path +% +% general :: cells { string } => void. +% +% Use general('all') or +% >> general all +% To add all subdirs to path. +% +% Available subdirectories are: +% algo - Algorithms and APIs +% arrutils - General array manipulations +% cellutils - Cell manipulations +% fileutils - File handling +% funutils - Functional programming +% numerical - Numerical analysis (inc scalar, vector, matrix) +% discretise - Discretisation and quantisation tools + +function general(dirs) + if nargin<1, + disp('Type >> general all to add all subdirectories to matlab path'); + return; + end + + if strcmp(dirs,'all') + dirs={'algo','arrutils','cellutils','fileutils','funutils','numerical','discretise'}; + end + thisfile=which('general'); + seps=strfind(thisfile,filesep); + thisdir=thisfile(1:seps(end)); + for i=1:length(dirs) + addpath([thisdir,dirs{i}]); + end +end +