from
AddRecursivePath
by Michael Robbins
Adds the directory specified and all subdirectories to the path.
|
| AddRecursivePatha(in)
|
function AddRecursivePatha(in)
% ADDRECURSIVEPATH adds the directory specified and all subdirectories to
% the path
%
% This function was created before GenPath and may be helpful to those
% who do not have it.
%
% It is useful to put this function in your STARTUP.M file, so you can
% automatically add direcories to your path when you launch MATLAB. This
% way, even if your directory structure has changed, you will still
% include all your m-files.
%
% Example:
% AddRecursivePath('c:\dev\MATLAB');
%
% IT'S NOT FANCY, BUT IT WORKS
%
% See also path, what, cd, dir, addpath, rmpath, genpath, pathtool, savepath, rehash.
% MICHAEL ROBBINS
% MichaelRobbins1@yahoo.com
% MichaelRobbinsUsenet@yahoo.com
% robbins@bloomberg.net
[s,w]=dos(['dir ' in '/s']);
t=regexp(w,'Directory\sof\s([^\n]*)','tokens');
for i=1:length(t)
addpath(t{i}{:});
end;
|
|
Contact us at files@mathworks.com