Hi,
Yes, there is a problem with the previous solution because it's only valid for Matlab version >= 2011a. A solution that works for all Matlab versions >= 7.0 is as follows:
In dynare_solve.m, enter:
- Code: Select all
- if ~user_has_matlab_license('optimization_toolbox')
Then, add a file called user_has_matlab_license.m with the following code:
- Code: Select all
- function [hasLicense] = user_has_matlab_license(toolbox)
 %[hasLicense] = user_has_matlab_license(toolbox)
 % checks for license using the appropriate function call
 %
 % INPUTS
 %   toolbox: string for toolbox name
 %
 % OUTPUTS
 %   hasLicense: bool indicating whether or not the user has the license
 %
 % SPECIAL REQUIREMENTS
 %   none
 
 % Copyright (C) 2012 Dynare Team
 %
 % This file is part of Dynare.
 %
 % Dynare is free software: you can redistribute it and/or modify
 % it under the terms of the GNU General Public License as published by
 % the Free Software Foundation, either version 3 of the License, or
 % (at your option) any later version.
 %
 % Dynare is distributed in the hope that it will be useful,
 % but WITHOUT ANY WARRANTY; without even the implied warranty of
 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 % GNU General Public License for more details.
 %
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
 if matlab_ver_less_than('7.12')
 hasLicense = license('test', toolbox);
 else
 [hasLicense ~] = license('checkout',toolbox);
 end
 end
 
Similar changes need to be made to dynare_config.m and solve_one_boundary.m. If you are comfortable with git, you can see the changes on the 4.2 branch in commit 5a580341337e51fcf17a4a877201a3bbf0be59d4