Global Index (all files) (short | long) | Local contents | Local Index (files in subdir) (short | long)
Set all paths for used toolboxes (for instance GEATbx)
A central place to define all necessary directory extensions
of the Matlab search path. This file can work for multiple
Matlab installations (multi user and multi version) and
multiple operating systems (here Win32 and UNIX).
Edit this file to your need and put it in a central place.
Then all users can access this file to add the defined paths
to their Matlab search path (see example below).
The existing Matlab search path is just extended. Thus,
this m-file works for all users on the same network.
This file is configured to add all paths of the GEATbx.
Syntax: toolboxpath
This file can be called by hand at the beginning of a
Matlab session (just change to the directory of the GEATbx
and call toolboxpath.
Or
This file can be called by the startup-file in
MATLABROOT\toolbox\local for WIN32
~/matlab for UNIX
% Example of Startup M-file (startup.m).
pwdact = pwd;
% change directory to find toolboxpath.m
if strcmp(computer,'PCWIN')
cd P:ATH\TO\geatbx;
else cd /PATH/TO/geatbx; end;
% set the new path
toolboxpath;
% and return
cd(pwdact);
Then, all the necesary path information will be included
in the MATLAB path (added at the end of the MATLAB path).
% Author: Hartmut Pohlheim
% History: 30.02.2000 reworked
% 26.08.2001 docu extended
% 08.12.2002 relative paths used
% 28.05.2005 tsp path for examples added
% when the target system is one of the many Windows-PC's
if strcmp(computer,'PCWIN')
% Path2GEATbx = 'I:NCLUDE\ABSOLUTE\PATH\geatbx\'; % absolute path
Path2GEATbx = [pwd, filesep]; % relative path, current dir
Div = ';';
% when we are using an UNIX system
else
% Path2GEATbx = '/INCLUDE/ABSOLUTE/PATH/geatbx/'; % absolute path
Path2GEATbx = [pwd, filesep]; % relative path, current dir
Div = ':';
end
matlabpath([...
path, Div,...
Path2GEATbx Div,...
Path2GEATbx 'objfun' Div,...
Path2GEATbx 'plotext' Div,...
Path2GEATbx 'scripts' Div,...
Path2GEATbx 'utils' Div,...
Path2GEATbx 'objfun' filesep 'tsp' Div,...
Path2GEATbx 'objfun' filesep 'vrp' Div,...
]);
% End of script
| GEATbx: | Main page Tutorial Algorithms M-functions Parameter/Options Example functions www.geatbx.com |