license('test',' ... ') gives 1 even if the license exists but it is not active, implying a crash of the dynare matlab session.

time-shift
Marco Ratto 2011-10-26 09:18:47 +02:00
parent 0130d6cbe4
commit dde9d2bfee
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ if ~exist('OCTAVE_VERSION')
addpath([dynareroot '/missing/rows_columns']) addpath([dynareroot '/missing/rows_columns'])
% Replacement for vec() (inexistent under MATLAB) % Replacement for vec() (inexistent under MATLAB)
addpath([dynareroot '/missing/vec']) addpath([dynareroot '/missing/vec'])
if ~license('test', 'statistics_toolbox') if isempty(license('inuse','statistics_toolbox'))
% Replacements for functions of the stats toolbox % Replacements for functions of the stats toolbox
addpath([dynareroot '/missing/stats/']) addpath([dynareroot '/missing/stats/'])
end end
@ -96,7 +96,7 @@ if exist('OCTAVE_VERSION')
addpath([dynareroot '/missing/nanmean']) addpath([dynareroot '/missing/nanmean'])
end end
else else
if ~license('test', 'statistics_toolbox') if isempty(license('inuse','statistics_toolbox'))
addpath([dynareroot '/missing/nanmean']) addpath([dynareroot '/missing/nanmean'])
end end
end end

View File

@ -38,7 +38,7 @@ global options_
options_ = set_default_option(options_,'solve_algo',2); options_ = set_default_option(options_,'solve_algo',2);
info = 0; info = 0;
if options_.solve_algo == 0 if options_.solve_algo == 0
if ~exist('OCTAVE_VERSION') && ~license('test', 'optimization_toolbox') if ~exist('OCTAVE_VERSION') && isempty(license('inuse','optimization_toolbox'))
error('You can''t use solve_algo=0 since you don''t have MATLAB''s Optimization Toolbox') error('You can''t use solve_algo=0 since you don''t have MATLAB''s Optimization Toolbox')
end end
options=optimset('fsolve'); options=optimset('fsolve');