From 4512e85cb24a0b1279aedabf0b45dde42009b71d Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Mon, 18 Dec 2023 17:07:01 +0100
Subject: [PATCH] Restore outputs erroneously removed in 735bd66d

---
 matlab/+bvar/density.m           | 4 ++--
 matlab/dynare.m                  | 2 +-
 matlab/parallel/masterParallel.m | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/matlab/+bvar/density.m b/matlab/+bvar/density.m
index 9e1a219db7..f24a7e4bba 100644
--- a/matlab/+bvar/density.m
+++ b/matlab/+bvar/density.m
@@ -75,8 +75,8 @@ function w = matrictint(S, df, XXi)
 
 k=size(XXi,1);
 ny=size(S,1);
-cx = chol(XXi);
-cs = chol(S);
+[cx,p] = chol(XXi); %second output required to prevent error
+[cs,p] = chol(S); %second output required to prevent error
 
 if any(diag(cx)<100*eps)
     error('singular XXi')
diff --git a/matlab/dynare.m b/matlab/dynare.m
index 7cddb7abd0..2308ad8e33 100644
--- a/matlab/dynare.m
+++ b/matlab/dynare.m
@@ -240,7 +240,7 @@ end
 % https://forum.dynare.org/t/issue-with-dynare-preprocessor-4-6-1/15448/1
 if ~fast
     if ispc && ~isoctave && exist(['+',fname(1:end-4)],'dir')
-        rmdir(['+', fname(1:end-4)],'s');
+        [~,~]=rmdir(['+', fname(1:end-4)],'s'); % output required to suppress triggering error
     end
 end
 
diff --git a/matlab/parallel/masterParallel.m b/matlab/parallel/masterParallel.m
index f06b5e2416..f421d05cdc 100644
--- a/matlab/parallel/masterParallel.m
+++ b/matlab/parallel/masterParallel.m
@@ -893,7 +893,7 @@ switch Strategy
         end
 
         if isempty(dir('dynareParallelLogFiles'))
-            rmdir('dynareParallelLogFiles');
+            [~,~]=rmdir('dynareParallelLogFiles'); %use outputs to not trigger hard error
             mkdir('dynareParallelLogFiles');
         end
         try
@@ -911,7 +911,7 @@ switch Strategy
     delete('temp_input.mat')
     if newInstance
         if isempty(dir('dynareParallelLogFiles'))
-            rmdir('dynareParallelLogFiles');
+            [~,~]=rmdir('dynareParallelLogFiles'); %use outputs to not trigger hard error
             mkdir('dynareParallelLogFiles');
         end
     end
-- 
GitLab