Bug fix. Variables INFO or info may be matlab's structure (isnan cannot be applied on a structure).

time-shift
Stéphane Adjemian (Charybdis) 2010-05-05 15:34:24 +02:00
parent f85b47e6ed
commit f25371bf6a
2 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ while (t<=sample_size)
norme
INFO
end
if isnan(INFO)
if ~isstruct(INFO) && isnan(INFO)
t = t-1;
new_draw = 0;
else

View File

@ -45,7 +45,7 @@ end
if reduce_step
step=step/1.5;
[info,number_of_calls] = homotopic_steps(tdx,positive_var_indx,shocks,old_weight,step,init,number_of_calls);
if ~isnan(info)
if isstruct(info) && ~isnan(info.error)
time = time+info.time;
return
else