From 47745cbe60ae1594c4138e0ff56ede706cb51945 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Sat, 5 May 2018 10:29:37 +0200
Subject: [PATCH] Fixes issue #1607.

(cherry picked from commit fa67aeb7a6c55697fc990db8275e35b492396bb6)
---
 matlab/dyn_first_order_solver.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/matlab/dyn_first_order_solver.m b/matlab/dyn_first_order_solver.m
index a09aa1645e..b7ddf94fdf 100644
--- a/matlab/dyn_first_order_solver.m
+++ b/matlab/dyn_first_order_solver.m
@@ -230,13 +230,12 @@ else
 
     nba = nd-sdim;
 
-    if task == 1
+    if task==1
         if rcond(w(npred+nboth+1:end,npred+nboth+1:end)) < 1e-9
             dr.full_rank = 0;
         else
             dr.full_rank = 1;
         end
-        return
     end
 
     if nba ~= nsfwrd
@@ -251,8 +250,11 @@ else
         info(2) = temp'*temp;
         return
     end
+
+    if task==1, return, end
+
     %First order approximation
-    indx_stable_root = 1: (nd - nsfwrd);     %=> index of stable roots
+    indx_stable_root = 1: (nd - nsfwrd);         %=> index of stable roots
     indx_explosive_root = npred + nboth + 1:nd;  %=> index of explosive roots
                                                  % derivatives with respect to dynamic state variables
                                                  % forward variables
-- 
GitLab