0001 function [TorF, vstr, rdate] = have_feature_optim()
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 TorF = 0;
0018 vstr = '';
0019 rdate = '';
0020 matlab = have_feature('matlab');
0021 if ~matlab || (matlab && license('test', 'optimization_toolbox'))
0022 v = ver('optim');
0023 if length(v) > 1
0024 warning('The built-in VER command is behaving strangely, probably as a result of installing a 3rd party toolbox in a directory named ''optim'' on your path. Check each element of the output of ver(''optim'') to find the offending toolbox, then move the toolbox to a more appropriately named directory.');
0025 v = v(1);
0026 end
0027 if ~isempty(v) && ~isempty(v.Version)
0028 TorF = 1;
0029 vstr = v.Version;
0030 rdate = v.Date;
0031 end
0032 end