diff --git a/matlab/ols/dyn_ols.m b/matlab/ols/dyn_ols.m
index dcb29aa02dfe6792780f97be3797cea383cee6bd..2a726a03dbe25a1f42fe60e4835a1e9b6e319cab 100644
--- a/matlab/ols/dyn_ols.m
+++ b/matlab/ols/dyn_ols.m
@@ -28,7 +28,7 @@ function ds = dyn_ols(ds, fitted_names_dict, eqtags, model_name, param_names, ds
 % SPECIAL REQUIREMENTS
 %   dynare must have been run with the option: json=compute
 
-% Copyright (C) 2017-2020 Dynare Team
+% Copyright (C) 2017-2021 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -186,7 +186,7 @@ for i = 1:length(Y)
         oo_.ols.(tag).Yhat = ...
             feval(fitted_names_dict{idx, 3}, oo_.ols.(tag).Yhat);
     end
-    ds.(oo_.ols.(tag).Yhat.name) = oo_.ols.(tag).Yhat;
+    ds.(oo_.ols.(tag).Yhat.name{:}) = oo_.ols.(tag).Yhat;
 
     %% Calculate statistics
     % Estimate for sigma^2
@@ -233,4 +233,4 @@ for i = 1:length(Y)
             [oo_.ols.(tag).beta oo_.ols.(tag).tstat oo_.ols.(tag).stderr]);
     end
 end
-end
\ No newline at end of file
+end
diff --git a/matlab/olsgibbs.m b/matlab/olsgibbs.m
index 43dfef938b527f26fc635f98f488e45670eb0c6a..336551582517f1a5d4816aff2d58c7b37f89aa01 100644
--- a/matlab/olsgibbs.m
+++ b/matlab/olsgibbs.m
@@ -30,7 +30,7 @@ function ds = olsgibbs(ds, eqtag, BetaPriorExpectation, BetaPriorVariance, s2, n
 % SPECIAL REQUIREMENTS
 %   dynare must have been run with the option: json=compute
 
-% Copyright (C) 2018-2019 Dynare Team
+% Copyright (C) 2018-2021 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -245,7 +245,7 @@ if any(idx) ...
     oo_.olsgibbs.(model_name).Yhat = ...
         feval(fitted_names_dict{idx, 3}, oo_.olsgibbs.(model_name).Yhat);
 end
-ds.(oo_.olsgibbs.(model_name).Yhat.name) = oo_.olsgibbs.(model_name).Yhat;
+ds.(oo_.olsgibbs.(model_name).Yhat.name{:}) = oo_.olsgibbs.(model_name).Yhat;
 
 % Compute and save posterior densities.
 for i=1:n