From 1c33af4844557f9a5ce95a1ab6f3e293006c0811 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 26 Oct 2018 11:11:10 +0200
Subject: [PATCH] Fix bug introduced in bfd93f4ac0ff1e with correlations in
 estim_params

For correlations, there is one extra columns (since there are two symbol
indices). MATLAB automatically adds the missing column, while Octave is
stricter when verifying dimensions.

By the way, add a missing comma.
---
 src/ComputingTasks.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc
index 9c87b5eb..72d669f4 100644
--- a/src/ComputingTasks.cc
+++ b/src/ComputingTasks.cc
@@ -1393,8 +1393,8 @@ EstimatedParamsStatement::writeOutput(ostream &output, const string &basename, b
 {
   output << "estim_params_.var_exo = zeros(0, 10);" << endl
          << "estim_params_.var_endo = zeros(0, 10);" << endl
-         << "estim_params_.corrx = zeros(0, 10);" << endl
-         << "estim_params_.corrn = zeros(0, 10);" << endl
+         << "estim_params_.corrx = zeros(0, 11);" << endl
+         << "estim_params_.corrn = zeros(0, 11);" << endl
          << "estim_params_.param_vals = zeros(0, 10);" << endl;
 
   for (const auto & it : estim_params_list)
@@ -1420,7 +1420,7 @@ EstimatedParamsStatement::writeOutput(ostream &output, const string &basename, b
             output << "estim_params_.corrx = [estim_params_.corrx; ";
           else if (symb_type == SymbolType::endogenous)
             output << "estim_params_.corrn = [estim_params_.corrn; ";
-          output << symb_id << " " << symbol_table.getTypeSpecificID(it.name2)+1;
+          output << symb_id << ", " << symbol_table.getTypeSpecificID(it.name2)+1;
           break;
         }
       output << ", ";
-- 
GitLab