From 43f2ec1d9d146624b29cedd48afad2859bf48313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= <stephane.adjemian@univ-lemans.fr> Date: Sat, 21 Feb 2015 13:58:52 +0100 Subject: [PATCH] Fixed display of the homotopy steps when the residuals are complex. --- matlab/perfect-foresight-models/perfect_foresight_solver.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matlab/perfect-foresight-models/perfect_foresight_solver.m b/matlab/perfect-foresight-models/perfect_foresight_solver.m index aab6185582..76f2b69dcd 100644 --- a/matlab/perfect-foresight-models/perfect_foresight_solver.m +++ b/matlab/perfect-foresight-models/perfect_foresight_solver.m @@ -137,7 +137,11 @@ if ~oo_.deterministic_simulation.status && ~options_.no_homotopy oo_.endo_simul = saved_endo_simul; success_counter = 0; step = step / 2; - fprintf('%i \t | %1.5f \t | %s \t | %e\n', iteration, new_weight, 'failed', me) + if isreal(me) + fprintf('%i \t | %1.5f \t | %s \t | %e\n', iteration, new_weight, 'failed', me) + else + fprintf('%i \t | %1.5f \t | %s \t | %s\n', iteration, new_weight, 'failed', 'Complex') + end end end fprintf('++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n') -- GitLab