From f25371bf6a2fe9a0926ca12789d452fc498fda1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Wed, 5 May 2010 15:34:24 +0200 Subject: [PATCH] Bug fix. Variables INFO or info may be matlab's structure (isnan cannot be applied on a structure). --- matlab/extended_path.m | 2 +- matlab/homotopic_steps.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/extended_path.m b/matlab/extended_path.m index ea4e424cb..73c3cc3ec 100644 --- a/matlab/extended_path.m +++ b/matlab/extended_path.m @@ -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 diff --git a/matlab/homotopic_steps.m b/matlab/homotopic_steps.m index 22d71d06f..aa798e8fd 100644 --- a/matlab/homotopic_steps.m +++ b/matlab/homotopic_steps.m @@ -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