% Note that this startup file will not actually work properly for matlab
% version 4 since addpath and rmpath are later additions to the language.

% $Id: startup.m,v 1.8 2004/12/16 00:59:25 man133 Exp man133 $
% Copyright J. V. Mansbridge, CSIRO, Tue Feb 23 02:51:35 EST 1999

% Get the matlab 'version number' as a number (with the extraneous decimal
% points stripped off).

ver = version;
versh = str2num(ver(1));
if versh < 5
  ver_num = versh;
else
  pos_dot = findstr(ver(3:length(ver)), '.');
  if ~isempty(pos_dot)
    ver(pos_dot(1)+2:length(ver)) = [];
  end
  ver_num = str2num(ver);
end

% get the name of the operating system (and strip lf).

[s, name_os] = unix('uname -s');
name_os = name_os(1:length(name_os) - 1);

clear ver versh pos_dot s name_os

if ver_num >= 7
  startup_v7
elseif ver_num >= 6
  startup_v6
elseif ver_num >= 5
  startup_v5
else
  startup_old
end
  
clear ver_num
