From 286ff64d51ce7c9359f54c1cbe1391116bb9b4d0 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Wed, 31 Jul 2019 15:03:38 -0400
Subject: [PATCH] handle initial value from smoother2histval for simulation

---
 src/gui_determ_simulation.m | 8 +++++++-
 src/gui_stoch_simulation.m  | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/gui_determ_simulation.m b/src/gui_determ_simulation.m
index 8cd4a38..b00f151 100644
--- a/src/gui_determ_simulation.m
+++ b/src/gui_determ_simulation.m
@@ -563,6 +563,12 @@ elseif strcmp(evt.NewValue.String, 'smoother')
         evt.OldValue.Value = 1;
         return
     end
-    handles.endoTable.Data(:,3) = num2cell(oo_.SmoothedVariables);
+    fname = inputdlg('output file from smoother2histval');
+    if isempty(fname)
+        evt.OldValue.Value = 1;
+    else
+        histvalf(fname{:})
+        handles.endoTable.Data(:,3) = num2cell(M_.endo_histval);
+    end
 end
 end
\ No newline at end of file
diff --git a/src/gui_stoch_simulation.m b/src/gui_stoch_simulation.m
index 8b72b07..3fcd77a 100644
--- a/src/gui_stoch_simulation.m
+++ b/src/gui_stoch_simulation.m
@@ -128,6 +128,7 @@ uicontrol(handles.buttongroup, ...
     'Style', 'radiobutton', ...
     'String', 'steady state', ...
     'Units', 'normalized', ...
+    'Value', 1, ...
     'Position', [0.3 0 1 1]);
 
 uicontrol(handles.buttongroup, ...
@@ -311,6 +312,12 @@ elseif strcmp(evt.NewValue.String, 'smoother')
         evt.OldValue.Value = 1;
         return
     end
-    handles.endoTable.Data(:,3) = num2cell(oo_.SmoothedVariables);
+    fname = inputdlg('output file from smoother2histval');
+    if isempty(fname)
+        evt.OldValue.Value = 1;
+    else
+        histvalf(fname{:})
+        handles.endoTable.Data(:,3) = num2cell(M_.endo_histval([model_settings.variables{:, 4}]));
+    end
 end
 end
-- 
GitLab