Fixed bug related to the initialization of the persistent variable.

time-shift
Stéphane Adjemian (Charybdis) 2011-09-21 08:30:26 +02:00
parent c4cfd0c857
commit c309b0cf57
1 changed files with 8 additions and 8 deletions

View File

@ -126,26 +126,26 @@ function [fval,exit_flag,ys,trend_coeff,info,Model,DynareOptions,BayesInfo,Dynar
% AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT FR % AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT FR
% Initialization of the returned variables and others...
fval = [];
ys = [];
trend_coeff = [];
exit_flag = 1;
info = 0;
% Declaration of the penalty as a persistent variable. % Declaration of the penalty as a persistent variable.
persistent penalty persistent penalty
% Initialization of the persistent variable. % Initialization of the persistent variable.
if ~nargin || isempty(penalty) if ~nargin || isempty(penalty)
penalty = 1e8; penalty = 1e8;
return if ~nargin, return, end
end end
if nargin==1 if nargin==1
penalty = xparam1; penalty = xparam1;
return return
end end
% Initialization of the returned variables and others...
fval = [];
ys = [];
trend_coeff = [];
exit_flag = 1;
info = 0;
% Set flag related to analytical derivatives. % Set flag related to analytical derivatives.
if nargout > 9 if nargout > 9
analytic_derivation=1; analytic_derivation=1;