From c5f21b17e7415958e9c78f514294dec42511802a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 18 May 2017 23:31:46 +0200
Subject: [PATCH] Fixed indentation.

---
 src/@dseries/align.m                          |   2 +-
 src/@dseries/baxter_king_filter.m             |  16 +-
 src/@dseries/center.m                         |   2 +-
 src/@dseries/cumprod.m                        |  34 +-
 src/@dseries/cumsum.m                         |  40 +--
 src/@dseries/eq.m                             |  10 +-
 src/@dseries/exist.m                          |   6 +-
 src/@dseries/extract.m                        |   6 +-
 src/@dseries/firstobservedperiod.m            |   4 +-
 src/@dseries/horzcat.m                        | 130 ++++----
 src/@dseries/hpcycle.m                        |  10 +-
 src/@dseries/hptrend.m                        |  10 +-
 src/@dseries/insert.m                         |   8 +-
 src/@dseries/isequal.m                        |   4 +-
 src/@dseries/isnan.m                          |   4 +-
 src/@dseries/mrdivide.m                       |   4 +-
 src/@dseries/ne.m                             |  10 +-
 src/@dseries/plot.m                           |   6 +-
 src/@dseries/plus.m                           |   2 +-
 src/@dseries/private/default_name.m           |   5 +-
 src/@dseries/set_names.m                      |   2 +-
 src/@dseries/std.m                            |   4 +-
 src/@dseries/subsasgn.m                       | 296 +++++++++---------
 src/@dseries/tex_rename.m                     |   2 +-
 src/@dseries/vertcat.m                        |  44 +--
 src/read/load_csv_file_data.m                 |   6 +-
 src/read/load_m_file_data.m                   |  14 +-
 src/read/load_mat_file_data.m                 |  10 +-
 src/read/load_xls_file_data.m                 |  28 +-
 src/utilities/file/check_file_extension.m     |   4 +-
 src/utilities/from/from.m                     |  70 ++---
 .../insert/insert_column_vector_in_a_matrix.m |   4 +-
 ...t_object_in_a_one_dimensional_cell_array.m |   4 +-
 ...e_object_in_a_one_dimensional_cell_array.m |   4 +-
 src/utilities/is/iscellofchar.m               |   4 +-
 src/utilities/is/isglobalinbase.m             |   4 +-
 src/utilities/missing/demean/demean.m         |   4 +-
 src/utilities/missing/ndim/ndim.m             |   4 +-
 .../sample_hp_filter/sample_hp_filter.m       |   4 +-
 .../str/common_strings_in_cell_arrays.m       |   5 +-
 src/utilities/str/get_random_string.m         |   4 +-
 src/utilities/str/name2tex.m                  |   4 +-
 .../build_list_of_variables_with_loops.m      |   4 +-
 .../build_list_of_variables_with_regexp.m     |  12 +-
 44 files changed, 425 insertions(+), 429 deletions(-)

diff --git a/src/@dseries/align.m b/src/@dseries/align.m
index 37eece4..e6dd75c 100644
--- a/src/@dseries/align.m
+++ b/src/@dseries/align.m
@@ -1,5 +1,5 @@
 function [a,b] = align(a, b) % --*-- Unitary tests --*--
-    
+
 %@info:
 %! @deftypefn {Function File} {[@var{a}, @var{b}] =} align (@var{a}, @var{b})
 %! @anchor{dseries/align}
diff --git a/src/@dseries/baxter_king_filter.m b/src/@dseries/baxter_king_filter.m
index 4232b5e..e36cf28 100644
--- a/src/@dseries/baxter_king_filter.m
+++ b/src/@dseries/baxter_king_filter.m
@@ -3,20 +3,20 @@ function ts = baxter_king_filter(ts, high_frequency, low_frequency, K) % --*-- U
 % ts = baxter_king_filter(ts, high_frequency, low_frequency, K)
 %
 % Implementation of Baxter and King (1999) band pass filter for dseries objects. The code is adapted from
-% the one provided by Baxter and King. This filter isolates business cycle fluctuations with a period of length 
+% the one provided by Baxter and King. This filter isolates business cycle fluctuations with a period of length
 % ranging between high_frequency to low_frequency (quarters).
 %
-% INPUTS 
+% INPUTS
 %  o ts                 dseries object.
 %  o high_frequency     positive scalar, period length (default value is 6).
 %  o low_frequency      positive scalar, period length (default value is 32).
 %  o K                  positive scalar integer, truncation parameter (default value is 12).
 %
-% OUTPUTS 
+% OUTPUTS
 %  o ts                 dseries object.
 %
-% REMARKS 
-% This filter use a (symmetric) moving average smoother, so that K observations at the beginning and at the end of the 
+% REMARKS
+% This filter use a (symmetric) moving average smoother, so that K observations at the beginning and at the end of the
 % sample are lost in the computation of the filter.
 
 % Copyright (C) 2013-2015 Dynare Team
@@ -57,7 +57,7 @@ if nargin<4 || isempty(K)
         end
     end
 end
-       
+
 % translate periods into frequencies.
 hf=2.0*pi/high_frequency;
 lf=2.0*pi/low_frequency;
@@ -88,7 +88,7 @@ tmp = zeros(size(ts.data));
 
 % Filtering step.
 for t = K+1:nobs(ts)-K
-    tmp(t,:)  = weights'*ts.data(t-K:t+K,:);    
+    tmp(t,:)  = weights'*ts.data(t-K:t+K,:);
 end
 
 % Update dseries object.
@@ -102,7 +102,7 @@ ts.dates = init:init+(nobs(ts)-1);
 %$ % Create a dataset.
 %$ e = .2*randn(200,1);
 %$ u = randn(200,1);
-%$ stochastic_trend = cumsum(e); 
+%$ stochastic_trend = cumsum(e);
 %$ deterministic_trend = .1*transpose(1:200);
 %$ x = zeros(200,1);
 %$ for i=2:200
diff --git a/src/@dseries/center.m b/src/@dseries/center.m
index 7548683..bbb75a2 100644
--- a/src/@dseries/center.m
+++ b/src/@dseries/center.m
@@ -31,7 +31,7 @@ if nargin<2
 end
 
 if geometric
-    o = o/mean(o, true); 
+    o = o/mean(o, true);
 else
     o = o-mean(o, false);
 end
diff --git a/src/@dseries/cumprod.m b/src/@dseries/cumprod.m
index 034d591..0b8a995 100644
--- a/src/@dseries/cumprod.m
+++ b/src/@dseries/cumprod.m
@@ -49,23 +49,23 @@ end
 
 switch nargin
   case 1
-      % Initialize the output.
-      B = varargin{1};
-      % Perform the cumulated sum
-      if isequal(idx, 1)
-          B.data = cumprod(B.data);
-      else
-          if common_first_period_witout_nan
-              B.data(idx:end,:) = cumprod(B.data(idx:end,:));
-          else
-              B.data = cumprodnan(B.data);
-          end
-      end
-      % Change the name of the variables
-      for i=1:vobs(B)
-          B.name(i) = {['cumprod(' B.name{i} ')']};
-          B.tex(i) = {['\prod_t ' B.tex{i}]};
-      end
+    % Initialize the output.
+    B = varargin{1};
+    % Perform the cumulated sum
+    if isequal(idx, 1)
+        B.data = cumprod(B.data);
+    else
+        if common_first_period_witout_nan
+            B.data(idx:end,:) = cumprod(B.data(idx:end,:));
+        else
+            B.data = cumprodnan(B.data);
+        end
+    end
+    % Change the name of the variables
+    for i=1:vobs(B)
+        B.name(i) = {['cumprod(' B.name{i} ')']};
+        B.tex(i) = {['\prod_t ' B.tex{i}]};
+    end
   case 2
     if isdseries(varargin{2})
         if ~isequal(vobs(varargin{1}), vobs(varargin{2}))
diff --git a/src/@dseries/cumsum.m b/src/@dseries/cumsum.m
index 3655c82..ba01fab 100644
--- a/src/@dseries/cumsum.m
+++ b/src/@dseries/cumsum.m
@@ -2,12 +2,12 @@ function B = cumsum(varargin) % --*-- Unitary tests --*--
 
 % Overloads matlab's cumsum function for dseries objects.
 %
-% INPUTS 
+% INPUTS
 %  o A     dseries object [mandatory].
 %  o d     dates object [optional]
 %  o v     dseries object with one observation [optional]
 %
-% OUTPUTS 
+% OUTPUTS
 %  o B     dseries object.
 
 % Copyright (C) 2013-2016 Dynare Team
@@ -48,24 +48,24 @@ else
 end
 
 switch nargin
-    case 1
-      % Initialize the output.
-      B = varargin{1};
-      % Perform the cumulated sum
-      if isequal(idx, 1)
-          B.data = cumsum(B.data);
-      else
-          if common_first_period_witout_nan
-              B.data(idx:end,:) = cumsum(B.data(idx:end,:));
-          else
-              B.data = cumsumnan(B.data);
-          end
-      end
-      % Change the name of the variables
-      for i=1:vobs(B)
-          B.name(i) = {['cumsum(' B.name{i} ')']};
-          B.tex(i) = {['\sum_t ' B.tex{i}]};
-      end
+  case 1
+    % Initialize the output.
+    B = varargin{1};
+    % Perform the cumulated sum
+    if isequal(idx, 1)
+        B.data = cumsum(B.data);
+    else
+        if common_first_period_witout_nan
+            B.data(idx:end,:) = cumsum(B.data(idx:end,:));
+        else
+            B.data = cumsumnan(B.data);
+        end
+    end
+    % Change the name of the variables
+    for i=1:vobs(B)
+        B.name(i) = {['cumsum(' B.name{i} ')']};
+        B.tex(i) = {['\sum_t ' B.tex{i}]};
+    end
   case 2
     if isdseries(varargin{2})
         if ~isequal(vobs(varargin{1}), vobs(varargin{2}))
diff --git a/src/@dseries/eq.m b/src/@dseries/eq.m
index e60d45e..83c8a0b 100644
--- a/src/@dseries/eq.m
+++ b/src/@dseries/eq.m
@@ -2,15 +2,15 @@ function C = eq(A,B) % --*-- Unitary tests --*--
 
 % Overloads eq (==) operator.
 %
-% INPUTS 
+% INPUTS
 %  o A      dseries object (T periods, N variables).
 %  o B      dseries object (T periods, N variables).
 %
-% OUTPUTS 
-%  o C      T*N matrix of zeros and ones. Element C(t,n) is nonzero iff observation t of variable n in A and B are equal.  
+% OUTPUTS
+%  o C      T*N matrix of zeros and ones. Element C(t,n) is nonzero iff observation t of variable n in A and B are equal.
 %
-% REMARKS 
-%  If the number of variables, the number of observations or the frequencies are different in A and B, the function returns a zero scalar. 
+% REMARKS
+%  If the number of variables, the number of observations or the frequencies are different in A and B, the function returns a zero scalar.
 
 % Copyright (C) 2013 Dynare Team
 %
diff --git a/src/@dseries/exist.m b/src/@dseries/exist.m
index e4d5e38..3575af0 100644
--- a/src/@dseries/exist.m
+++ b/src/@dseries/exist.m
@@ -2,12 +2,12 @@ function l = exist(o, varname) % --*-- Unitary tests --*--
 
 % Tests if a variable exists in dseries object o.
 %
-% INPUTS 
+% INPUTS
 %  - o       [dseries], dseries object.
 %  - varname [string],  name of a variable.
 %
-% OUTPUTS 
-%  - l       [logical], equal to 1 (true) iff varname is a variable in dseries object o. 
+% OUTPUTS
+%  - l       [logical], equal to 1 (true) iff varname is a variable in dseries object o.
 
 % Copyright (C) 2014 Dynare Team
 %
diff --git a/src/@dseries/extract.m b/src/@dseries/extract.m
index f50899a..0900ec6 100644
--- a/src/@dseries/extract.m
+++ b/src/@dseries/extract.m
@@ -1,7 +1,7 @@
 function A = extract(B,varargin) % --*-- Unitary tests --*--
 
 % Extract some variables from a database.
-    
+
 % Copyright (C) 2012-2016 Dynare Team
 %
 % This file is part of Dynare.
@@ -67,8 +67,8 @@ A.data = B.data(:,idVariableName);
 A.dates = B.dates;
 A.name = B.name(idVariableName);
 A.tex = B.tex(idVariableName);
-    
-    
+
+
 %@test:1
 %$ % Define a data set.
 %$ A = rand(10,24);
diff --git a/src/@dseries/firstobservedperiod.m b/src/@dseries/firstobservedperiod.m
index 92c1b23..5ef31bf 100644
--- a/src/@dseries/firstobservedperiod.m
+++ b/src/@dseries/firstobservedperiod.m
@@ -2,10 +2,10 @@ function d = firstobservedperiod(o) % --*-- Unitary tests --*--
 
 % Returns the first period where all the variables are observed (first period without NaNs).
 %
-% INPUTS 
+% INPUTS
 % - o [dseries]    with N variables and T periods.
 %
-% OUTPUTS 
+% OUTPUTS
 % - b [dates]      First period where the N variables are observed (without NaNs).
 
 % Copyright (C) 2016-2017 Dynare Team
diff --git a/src/@dseries/horzcat.m b/src/@dseries/horzcat.m
index b6af0b0..a93d5ee 100644
--- a/src/@dseries/horzcat.m
+++ b/src/@dseries/horzcat.m
@@ -2,24 +2,24 @@ function B = horzcat(varargin) % --*-- Unitary tests --*--
 
 % Overloads horzcat method for dseries objects.
 %
-% INPUTS 
+% INPUTS
 %  o A1    dseries object.
 %  o A2    dseries object.
 %  o ...
 %
-% OUTPUTS 
+% OUTPUTS
 %  o B     dseries object.
 %
-% EXAMPLE 1 
+% EXAMPLE 1
 %  If A, B and C are dseries objects the following syntax:
-%    
+%
 %    D = [A, B, C] ;
 %
 %  Defines a dseries object D containing the variables appearing in A, B and C.
 %
-% REMARKS 
+% REMARKS
 %  o A1, A2, ... must not have common variables.
-    
+
 % Copyright (C) 2011-2017 Dynare Team
 %
 % This file is part of Dynare.
@@ -50,72 +50,72 @@ switch nargin
 end
 
 function a = concatenate(b,c)
-    [n,message] = common_strings_in_cell_arrays(b.name,c.name);
-    if isempty(b)
-        a = c;
-        return
-    end
-    if isempty(c)
-        a = b;
-        return
-    end
-    if n
-        error(['dseries::horzcat: I cannot concatenate dseries objects with common variable names (' message ')!'])
-    end
-    if ~isequal(frequency(b),frequency(c))
-        error('dseries::horzcat: All time series objects must have common frequency!')
+[n,message] = common_strings_in_cell_arrays(b.name,c.name);
+if isempty(b)
+    a = c;
+    return
+end
+if isempty(c)
+    a = b;
+    return
+end
+if n
+    error(['dseries::horzcat: I cannot concatenate dseries objects with common variable names (' message ')!'])
+end
+if ~isequal(frequency(b),frequency(c))
+    error('dseries::horzcat: All time series objects must have common frequency!')
+else
+    a = dseries();
+end
+d_nobs_flag = 0;
+if ~isequal(nobs(b),nobs(c))
+    d_nobs_flag = 1;
+end
+d_init_flag = 0;
+if ~isequal(firstdate(b),firstdate(c))
+    d_init_flag = 1;
+end
+a.name = vertcat(b.name,c.name);
+a.tex  = vertcat(b.tex,c.tex);
+if ~( d_nobs_flag(1) || d_init_flag(1) )
+    a.data = [b.data,c.data];
+    a.dates = b.dates;
+else
+    nobs_b = nobs(b);
+    nobs_c = nobs(c);
+    if firstdate(b)<=firstdate(c)
+        if firstdate(b)<firstdate(c)
+            c.data = [NaN(firstdate(c)-firstdate(b), vobs(c)); c.data];
+        end
     else
-        a = dseries();
-    end
-    d_nobs_flag = 0;
-    if ~isequal(nobs(b),nobs(c))
-        d_nobs_flag = 1;
+        b.data = [NaN(firstdate(b)-firstdate(c), vobs(b)); b.data];
     end
-    d_init_flag = 0;
-    if ~isequal(firstdate(b),firstdate(c))
-        d_init_flag = 1;
+    b_last_date = firstdate(b)+nobs_b;
+    c_last_date = firstdate(c)+nobs_c;
+    if b_last_date<c_last_date
+        b.data = [b.data; NaN(c_last_date-b_last_date, vobs(b))];
+    elseif b_last_date>c_last_date
+        c.data = [c.data; NaN(b_last_date-c_last_date, vobs(c))];
     end
-    a.name = vertcat(b.name,c.name);
-    a.tex  = vertcat(b.tex,c.tex);
-    if ~( d_nobs_flag(1) || d_init_flag(1) )
-        a.data = [b.data,c.data];
-        a.dates = b.dates;
-    else
-        nobs_b = nobs(b);
-        nobs_c = nobs(c);
-        if firstdate(b)<=firstdate(c)
-            if firstdate(b)<firstdate(c)
-                c.data = [NaN(firstdate(c)-firstdate(b), vobs(c)); c.data];
-            end
-        else
-            b.data = [NaN(firstdate(b)-firstdate(c), vobs(b)); b.data];
-        end
-        b_last_date = firstdate(b)+nobs_b;
-        c_last_date = firstdate(c)+nobs_c;
-        if b_last_date<c_last_date
-            b.data = [b.data; NaN(c_last_date-b_last_date, vobs(b))];
-        elseif b_last_date>c_last_date
-            c.data = [c.data; NaN(b_last_date-c_last_date, vobs(c))];
-        end
-
-        fillerdates = dates();
-        if max(c.dates) < min(b.dates)
-            fillerdates = max(c.dates):min(b.dates);
-        end
-        if max(b.dates) < min(c.dates)
-            fillerdates = max(b.dates):min(c.dates);
-        end
 
-        if isempty(fillerdates)
-            hd = [b.dates, c.dates];
-        else
-            hd = [b.dates, fillerdates, c.dates];
-        end
+    fillerdates = dates();
+    if max(c.dates) < min(b.dates)
+        fillerdates = max(c.dates):min(b.dates);
+    end
+    if max(b.dates) < min(c.dates)
+        fillerdates = max(b.dates):min(c.dates);
+    end
 
-        a.data = [b.data, c.data];
-        a.dates = sort(unique(hd));
+    if isempty(fillerdates)
+        hd = [b.dates, c.dates];
+    else
+        hd = [b.dates, fillerdates, c.dates];
     end
 
+    a.data = [b.data, c.data];
+    a.dates = sort(unique(hd));
+end
+
 %@test:1
 %$ % Define a data set.
 %$ A = [transpose(1:10),2*transpose(1:10)];
diff --git a/src/@dseries/hpcycle.m b/src/@dseries/hpcycle.m
index 90dd653..faf2e0f 100644
--- a/src/@dseries/hpcycle.m
+++ b/src/@dseries/hpcycle.m
@@ -4,11 +4,11 @@ function ts = hpcycle(ts, lambda) % --*-- Unitary tests --*--
 %
 % Extracts the cycle component from a dseries object using Hodrick Prescott filter.
 %
-% INPUTS 
+% INPUTS
 %  o ts         dseries object.
 %  o lambda     positive scalar, trend smoothness parameter.
 %
-% OUTPUTS 
+% OUTPUTS
 %  o ts         dseries object, with time series replaced by the cyclical component of the original time series.
 
 % Copyright (C) 2013 Dynare Team
@@ -28,13 +28,13 @@ function ts = hpcycle(ts, lambda) % --*-- Unitary tests --*--
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-if nargin>1 
+if nargin>1
     if lambda<=0
         error(['dseries::hpcycle: Lambda must be a positive integer!'])
     end
 else
     lambda = [];
-end 
+end
 
 for i=1:vobs(ts)
     ts.name(i) = {['hpcycle(' ts.name{i} ')']};
@@ -50,7 +50,7 @@ ts.data = data;
 %$ % Create a dataset.
 %$ e = .2*randn(200,1);
 %$ u = randn(200,1);
-%$ stochastic_trend = cumsum(e); 
+%$ stochastic_trend = cumsum(e);
 %$ deterministic_trend = .1*transpose(1:200);
 %$ x = zeros(200,1);
 %$ for i=2:200
diff --git a/src/@dseries/hptrend.m b/src/@dseries/hptrend.m
index 6c699f9..c88561e 100644
--- a/src/@dseries/hptrend.m
+++ b/src/@dseries/hptrend.m
@@ -4,11 +4,11 @@ function ts = hptrend(ts, lambda) % --*-- Unitary tests --*--
 %
 % Extracts the trend component from a dseries object using Hodrick Prescott filter.
 %
-% INPUTS 
+% INPUTS
 %  o ts         dseries object.
 %  o lambda     positive scalar, trend smoothness parameter.
 %
-% OUTPUTS 
+% OUTPUTS
 %  o ts         dseries object, with time series replaced by the trend component of the original time series.
 
 % Copyright (C) 2013 Dynare Team
@@ -28,7 +28,7 @@ function ts = hptrend(ts, lambda) % --*-- Unitary tests --*--
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-if nargin>1 
+if nargin>1
     if lambda<=0
         error(['dseries::hptrend: Lambda must be a positive integer!'])
     end
@@ -44,12 +44,12 @@ end
 ts.data = sample_hp_filter(ts.data,lambda);
 
 %@test:1
-%$ plot_flag = 0; 
+%$ plot_flag = 0;
 %$
 %$ % Create a dataset.
 %$ e = .2*randn(200,1);
 %$ u = randn(200,1);
-%$ stochastic_trend = cumsum(e); 
+%$ stochastic_trend = cumsum(e);
 %$ deterministic_trend = .1*transpose(1:200);
 %$ x = zeros(200,1);
 %$ for i=2:200
diff --git a/src/@dseries/insert.m b/src/@dseries/insert.m
index a6f17ea..b27c3d9 100644
--- a/src/@dseries/insert.m
+++ b/src/@dseries/insert.m
@@ -61,10 +61,10 @@ end
 n = length(id);
 
 if n>1
-   [id, jd] = sort(id);
-   us.data = us.data(:,jd);
-   us.name = us.name(jd);
-   us.tex = us.tex(jd);
+    [id, jd] = sort(id);
+    us.data = us.data(:,jd);
+    us.name = us.name(jd);
+    us.tex = us.tex(jd);
 end
 
 for i=1:n
diff --git a/src/@dseries/isequal.m b/src/@dseries/isequal.m
index 8a3c99a..4d4afad 100644
--- a/src/@dseries/isequal.m
+++ b/src/@dseries/isequal.m
@@ -2,12 +2,12 @@ function C = isequal(A, B, tol)
 
 % Overloads the isequal Matlab/Octave's function.
 %
-% INPUTS 
+% INPUTS
 %  o A      dseries object (T periods, N variables).
 %  o B      dseries object (T periods, N variables).
 %  o tol    tolerance parameter.
 %
-% OUTPUTS 
+% OUTPUTS
 %  o C      Integer scalar equal to zero or one.
 
 % Copyright (C) 2013 Dynare Team
diff --git a/src/@dseries/isnan.m b/src/@dseries/isnan.m
index 4169415..fbf9fd7 100644
--- a/src/@dseries/isnan.m
+++ b/src/@dseries/isnan.m
@@ -3,10 +3,10 @@ function b = isnan(o) % --*-- Unitary tests --*--
 % Returns an array of logicals (true/false). Element (t,i) is true iff the i-th variable at
 % period number t is not a NaN.
 %
-% INPUTS 
+% INPUTS
 % - o [dseries]    with N variables and T periods.
 %
-% OUTPUTS 
+% OUTPUTS
 % - b [logical]    T*N array of logicals.
 
 
diff --git a/src/@dseries/mrdivide.m b/src/@dseries/mrdivide.m
index 8dfacbc..280734b 100644
--- a/src/@dseries/mrdivide.m
+++ b/src/@dseries/mrdivide.m
@@ -39,7 +39,7 @@ function A = mrdivide(B,C) % --*-- Unitary tests --*--
 %
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
- 
+
 if isnumeric(B) && (isscalar(B) ||  isvector(B))
     if ~isdseries(C)
         error('dseries::mrdivide: Second input argument must be a dseries object!')
@@ -56,7 +56,7 @@ if isnumeric(C) && (isscalar(C) || isvector(C))
     A = B;
     A.data = bsxfun(@rdivide,B.data,C);
     return
-end    
+end
 
 if isdseries(B) && isdseries(C)
     % Element by element divisions of two dseries object
diff --git a/src/@dseries/ne.m b/src/@dseries/ne.m
index d87f15f..d9ed6e4 100644
--- a/src/@dseries/ne.m
+++ b/src/@dseries/ne.m
@@ -2,15 +2,15 @@ function C = ne(A,B) % --*-- Unitary tests --*--
 
 % Overloads ne (~=) operator.
 %
-% INPUTS 
+% INPUTS
 %  o A      dseries object (T periods, N variables).
 %  o B      dseries object (T periods, N variables).
 %
-% OUTPUTS 
-%  o C      T*N matrix of zeros and ones. Element C(t,n) is nonzero iff observation t of variable n in A and B are different.  
+% OUTPUTS
+%  o C      T*N matrix of zeros and ones. Element C(t,n) is nonzero iff observation t of variable n in A and B are different.
 %
-% REMARKS 
-%  If the number of variables, the number of observations or the frequencies are different in A and B, the function returns one. 
+% REMARKS
+%  If the number of variables, the number of observations or the frequencies are different in A and B, the function returns one.
 
 % Copyright (C) 2013 Dynare Team
 %
diff --git a/src/@dseries/plot.m b/src/@dseries/plot.m
index 058a44d..975e009 100644
--- a/src/@dseries/plot.m
+++ b/src/@dseries/plot.m
@@ -1,6 +1,6 @@
 function h = plot(ts, varargin)
 
-% Overloads Matlab/Octave's plot function for dseries objects. 
+% Overloads Matlab/Octave's plot function for dseries objects.
 
 % Copyright (C) 2013 Dynare Team
 %
@@ -70,7 +70,7 @@ switch ndseries
         hh = plot(ts0.data, ts1.data, varargin{2:end});
     else
         if length(varargin)>1
-             message = sprintf('dseries::plot: dseries objects %s and %s have %d>1 variables but you passed additional arguments to the plot function.\n                        These additional arguments won''t ne interpreted. Use the Matlab/Octave set command and the plot\n                        handle instead if you wish to modify the properties of the plotted time series.',inputname(1),inputname(2),nvariables);
+            message = sprintf('dseries::plot: dseries objects %s and %s have %d>1 variables but you passed additional arguments to the plot function.\n                        These additional arguments won''t ne interpreted. Use the Matlab/Octave set command and the plot\n                        handle instead if you wish to modify the properties of the plotted time series.',inputname(1),inputname(2),nvariables);
             warning(message)
         end
         hh = plot(ts0.data, ts1.data);
@@ -80,5 +80,5 @@ switch ndseries
 end
 
 if nargout
-     h = hh;
+    h = hh;
 end
\ No newline at end of file
diff --git a/src/@dseries/plus.m b/src/@dseries/plus.m
index d37b506..6aa6567 100644
--- a/src/@dseries/plus.m
+++ b/src/@dseries/plus.m
@@ -146,7 +146,7 @@ end
 %$    ts1 = dseries(A,[],A_name,[]);
 %$    ts2 = dseries(B,[],B_name,[]);
 %$    ts3 = ts1+ts2;
-%$    ts4 = ts3+ts1; 
+%$    ts4 = ts3+ts1;
 %$    t(1) = 1;
 %$ catch
 %$    t = 0;
diff --git a/src/@dseries/private/default_name.m b/src/@dseries/private/default_name.m
index 1711195..ea3f615 100644
--- a/src/@dseries/private/default_name.m
+++ b/src/@dseries/private/default_name.m
@@ -17,11 +17,8 @@ function names = default_name(dim)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-    
+
 names = {};
 for i=1:dim
     names = vertcat(names, {['Variable_' int2str(i)]});
 end
-
-
-
diff --git a/src/@dseries/set_names.m b/src/@dseries/set_names.m
index d17a2e8..f0afaf6 100644
--- a/src/@dseries/set_names.m
+++ b/src/@dseries/set_names.m
@@ -77,7 +77,7 @@ end
 %$ catch
 %$    t = 0;
 %$ end
-%$ 
+%$
 %$ if length(t)>1
 %$    t(2) = dassert(ts2.vobs,3);
 %$    t(3) = dassert(ts2.nobs,10);
diff --git a/src/@dseries/std.m b/src/@dseries/std.m
index 7cedf39..845e1dd 100644
--- a/src/@dseries/std.m
+++ b/src/@dseries/std.m
@@ -96,7 +96,7 @@ end
 %$ catch
 %$    t = 0;
 %$ end
-%$ 
+%$
 %$ if t(1)
 %$    t(2) = dassert(isequal(size(s),[1, 2]), true);
 %$    t(3) = dassert(max(abs(s-[.1, .1]))<.0001, true);
@@ -116,7 +116,7 @@ end
 %$ catch
 %$    t = 0;
 %$ end
-%$ 
+%$
 %$ if t(1)
 %$    t(2) = dassert(isequal(size(s),[1, 2]), true);
 %$    t(3) = dassert(max(abs(s-[.1, .1]))<.0001, true);
diff --git a/src/@dseries/subsasgn.m b/src/@dseries/subsasgn.m
index f34436f..2c3ca51 100644
--- a/src/@dseries/subsasgn.m
+++ b/src/@dseries/subsasgn.m
@@ -28,156 +28,156 @@ function A = subsasgn(A,S,B) % --*-- Unitary tests --*--
 merge_dseries_objects = 1;
 
 switch length(S)
-    case 1
-      switch S(1).type
-        case '{}' % Multiple variable selection.
-          if ~isequal(numel(S(1).subs),numel(unique(S(1).subs)))
-              error('dseries::subsasgn: Wrong syntax!')
-          end
-          for i=1:numel(S(1).subs)
-              element = S(1).subs{i};
-              % Implicit loop.
-              idArobase = strfind(element,'@');
-              if mod(length(idArobase),2)
-                  error('dseries::subsasgn: (Implicit loops) The number of @ symbols must be even!')
-              end
-              % regular expression.
-              idBracket.open = strfind(element, '[');
-              idBracket.close = strfind(element, ']');
-              if ~isequal(length(idBracket.open),length(idBracket.open))
-                  error('dseries::subsasgn: (Matlab/Octave''s regular expressions) Check opening and closing square brackets!')
-              end
-              % Loops and regular expressions are not compatible
-              if length(idArobase) && length(idBracket.open)
-                  error(['dseries::subsasgn: You cannot use implicit loops and regular expressions in the same rule!'])
-              end
-              if ~isempty(idArobase)
-                  elements = build_list_of_variables_with_loops({}, idArobase, element, {});
-                  S(1).subs = replace_object_in_a_one_dimensional_cell_array(S(1).subs, elements(:), i);
-              end
-              if ~isempty(idBracket.open)
-                  elements = build_list_of_variables_with_regexp(A.name, idBracket, element, {});
-                  S(1).subs = replace_object_in_a_one_dimensional_cell_array(S(1).subs, elements(:), i);
-              end
-          end
-          if isempty(B)
-              for i=1:length(S(1).subs)
-                  A = remove(A,S(1).subs{i});
-              end
-              return
-          end
-          if ~isequal(length(S(1).subs),vobs(B))
-              error('dseries::subsasgn: Wrong syntax!')
-          end
-          if ~isequal(S(1).subs(:),B.name)
-              for i = 1:vobs(B)
-                  if ~isequal(S(1).subs{i},B.name{i})
-                      % Rename a variable.
-                      id = find(strcmp(S(1).subs{i},A.name));
-                      if isempty(id)
-                          % Add a new variable a change its name.
-                          B.name(i) = {S(1).subs{i}};
-                          B.tex(i) = {name2tex(S(1).subs{i})};
-                      else
-                          % Rename variable and change its content.
-                          B.name(i) = A.name(id);
-                          B.tex(i) = A.tex(id);
-                      end
-                  end
-              end
-          end
-        case '.'
-          if isequal(S(1).subs,'init') && isdates(B) && isequal(length(B),1)
-              % Change the initial date (update dates member)
-              A.dates = B:B+(nobs(A)-1);
-              return
-          elseif isequal(S(1).subs,'dates') && isdates(B)
-              % Overwrite the dates member
-              A.dates = B;
-              return
-          elseif ismember(S(1).subs,{'data','name','tex'})
-              error(['dseries::subsasgn: You cannot overwrite ' S(1).subs ' member!'])
-          elseif ~isequal(S(1).subs,B.name)
-              % Single variable selection.
-              if ~isequal(S(1).subs,B.name{1})
-                  % Rename a variable.
-                  id = find(strcmp(S(1).subs,A.name));
-                  if isempty(id)
-                      % Add a new variable a change its name.
-                      B.name(1) = {S(1).subs};
-                      B.tex(1) = {name2tex(S(1).subs)};
-                  else
-                      % Rename variable and change its content.
-                      B.name(1) = A.name(id);
-                      B.tex(1) = A.tex(id);
-                  end
-              end
-          end
-        case '()' % Date(s) selection
-          if isdates(S(1).subs{1}) || isdate(S(1).subs{1})
-                if isdate(S(1).subs{1})
-                    Dates = dates(S(1).subs{1});
+  case 1
+    switch S(1).type
+      case '{}' % Multiple variable selection.
+        if ~isequal(numel(S(1).subs),numel(unique(S(1).subs)))
+            error('dseries::subsasgn: Wrong syntax!')
+        end
+        for i=1:numel(S(1).subs)
+            element = S(1).subs{i};
+            % Implicit loop.
+            idArobase = strfind(element,'@');
+            if mod(length(idArobase),2)
+                error('dseries::subsasgn: (Implicit loops) The number of @ symbols must be even!')
+            end
+            % regular expression.
+            idBracket.open = strfind(element, '[');
+            idBracket.close = strfind(element, ']');
+            if ~isequal(length(idBracket.open),length(idBracket.open))
+                error('dseries::subsasgn: (Matlab/Octave''s regular expressions) Check opening and closing square brackets!')
+            end
+            % Loops and regular expressions are not compatible
+            if length(idArobase) && length(idBracket.open)
+                error(['dseries::subsasgn: You cannot use implicit loops and regular expressions in the same rule!'])
+            end
+            if ~isempty(idArobase)
+                elements = build_list_of_variables_with_loops({}, idArobase, element, {});
+                S(1).subs = replace_object_in_a_one_dimensional_cell_array(S(1).subs, elements(:), i);
+            end
+            if ~isempty(idBracket.open)
+                elements = build_list_of_variables_with_regexp(A.name, idBracket, element, {});
+                S(1).subs = replace_object_in_a_one_dimensional_cell_array(S(1).subs, elements(:), i);
+            end
+        end
+        if isempty(B)
+            for i=1:length(S(1).subs)
+                A = remove(A,S(1).subs{i});
+            end
+            return
+        end
+        if ~isequal(length(S(1).subs),vobs(B))
+            error('dseries::subsasgn: Wrong syntax!')
+        end
+        if ~isequal(S(1).subs(:),B.name)
+            for i = 1:vobs(B)
+                if ~isequal(S(1).subs{i},B.name{i})
+                    % Rename a variable.
+                    id = find(strcmp(S(1).subs{i},A.name));
+                    if isempty(id)
+                        % Add a new variable a change its name.
+                        B.name(i) = {S(1).subs{i}};
+                        B.tex(i) = {name2tex(S(1).subs{i})};
+                    else
+                        % Rename variable and change its content.
+                        B.name(i) = A.name(id);
+                        B.tex(i) = A.tex(id);
+                    end
+                end
+            end
+        end
+      case '.'
+        if isequal(S(1).subs,'init') && isdates(B) && isequal(length(B),1)
+            % Change the initial date (update dates member)
+            A.dates = B:B+(nobs(A)-1);
+            return
+        elseif isequal(S(1).subs,'dates') && isdates(B)
+            % Overwrite the dates member
+            A.dates = B;
+            return
+        elseif ismember(S(1).subs,{'data','name','tex'})
+            error(['dseries::subsasgn: You cannot overwrite ' S(1).subs ' member!'])
+        elseif ~isequal(S(1).subs,B.name)
+            % Single variable selection.
+            if ~isequal(S(1).subs,B.name{1})
+                % Rename a variable.
+                id = find(strcmp(S(1).subs,A.name));
+                if isempty(id)
+                    % Add a new variable a change its name.
+                    B.name(1) = {S(1).subs};
+                    B.tex(1) = {name2tex(S(1).subs)};
                 else
-                    Dates = S(1).subs{1};
+                    % Rename variable and change its content.
+                    B.name(1) = A.name(id);
+                    B.tex(1) = A.tex(id);
                 end
-              [junk, tdx] = intersect(A.dates.time,Dates.time,'rows');
-              if isdseries(B)
-                  [junk, tdy] = intersect(B.dates.time,Dates.time,'rows');
-                  if isempty(tdy)
-                      error('dseries::subsasgn: Periods of the dseries objects on the left and right hand sides must intersect!')
-                  end
-                  if ~isequal(vobs(A), vobs(B))
-                      error('dseries::subsasgn: Dimension error! The number of variables on the left and right hand side must match.')
-                  end
-                  A.data(tdx,:) = B.data(tdy,:);
-                  merge_dseries_objects = 0;
-              elseif isnumeric(B)
-                  merge_dseries_objects = 0;
-                  if isequal(length(tdx),rows(B))
-                      if isequal(columns(A.data),columns(B))
-                          A.data(tdx,:) = B;
-                      else
-                          error('dseries::subsasgn: Dimension error! The number of variables on the left and right hand side must match.')
-                      end
-                  else
-                      error('dseries::subsassgn: Dimension error! The number of periods on the left and right hand side must match.')
-                  end
-              else
-                  error('dseries::subsasgn: The object on the right hand side must be a dseries object or a numeric array!')
-              end
-          elseif ischar(S(1).subs{1}) && isequal(S(1).subs{1},':') && isempty(A)
-              if isnumeric(B)
-                  if isequal(rows(B),1)
-                      A.data = repmat(B,A.dates.ndat,1);
-                  elseif isequal(rows(B),A.dates.ndat)
-                      A.data = B;
-                  else
-                      error('dseries::subsasgn: Wrong syntax!')
-                  end
-                  if isempty(A.name)
-                      A.name = default_name(vobs(A));
-                      A.tex = name2tex(A.name);
-                  end
-              elseif isdseries(B)
-                  if isequal(nobs(B), 1)
-                      A.data = repmat(B.data,A.dates.ndat,1);
-                  elseif isequal(nobs(B), A.dates.ndat)
-                      A.data = B;
-                  else
-                      error('dseries::subsasgn: Wrong syntax!')
-                  end
-                  if isempty(A.name)
-                      A.name = B.name;
-                      A.tex = B.tex;
-                  end
-              end
-              return
-          else
-              error('dseries::subsasgn: Wrong syntax!')
-          end
-        otherwise
-          error('dseries::subsasgn: Wrong syntax!')
-      end
+            end
+        end
+      case '()' % Date(s) selection
+        if isdates(S(1).subs{1}) || isdate(S(1).subs{1})
+            if isdate(S(1).subs{1})
+                Dates = dates(S(1).subs{1});
+            else
+                Dates = S(1).subs{1};
+            end
+            [junk, tdx] = intersect(A.dates.time,Dates.time,'rows');
+            if isdseries(B)
+                [junk, tdy] = intersect(B.dates.time,Dates.time,'rows');
+                if isempty(tdy)
+                    error('dseries::subsasgn: Periods of the dseries objects on the left and right hand sides must intersect!')
+                end
+                if ~isequal(vobs(A), vobs(B))
+                    error('dseries::subsasgn: Dimension error! The number of variables on the left and right hand side must match.')
+                end
+                A.data(tdx,:) = B.data(tdy,:);
+                merge_dseries_objects = 0;
+            elseif isnumeric(B)
+                merge_dseries_objects = 0;
+                if isequal(length(tdx),rows(B))
+                    if isequal(columns(A.data),columns(B))
+                        A.data(tdx,:) = B;
+                    else
+                        error('dseries::subsasgn: Dimension error! The number of variables on the left and right hand side must match.')
+                    end
+                else
+                    error('dseries::subsassgn: Dimension error! The number of periods on the left and right hand side must match.')
+                end
+            else
+                error('dseries::subsasgn: The object on the right hand side must be a dseries object or a numeric array!')
+            end
+        elseif ischar(S(1).subs{1}) && isequal(S(1).subs{1},':') && isempty(A)
+            if isnumeric(B)
+                if isequal(rows(B),1)
+                    A.data = repmat(B,A.dates.ndat,1);
+                elseif isequal(rows(B),A.dates.ndat)
+                    A.data = B;
+                else
+                    error('dseries::subsasgn: Wrong syntax!')
+                end
+                if isempty(A.name)
+                    A.name = default_name(vobs(A));
+                    A.tex = name2tex(A.name);
+                end
+            elseif isdseries(B)
+                if isequal(nobs(B), 1)
+                    A.data = repmat(B.data,A.dates.ndat,1);
+                elseif isequal(nobs(B), A.dates.ndat)
+                    A.data = B;
+                else
+                    error('dseries::subsasgn: Wrong syntax!')
+                end
+                if isempty(A.name)
+                    A.name = B.name;
+                    A.tex = B.tex;
+                end
+            end
+            return
+        else
+            error('dseries::subsasgn: Wrong syntax!')
+        end
+      otherwise
+        error('dseries::subsasgn: Wrong syntax!')
+    end
   case 2
     merge_dseries_objects = 0;
     if ((isequal(S(1).type,'{}') || isequal(S(1).type,'.')) && isequal(S(2).type,'()'))
diff --git a/src/@dseries/tex_rename.m b/src/@dseries/tex_rename.m
index 801b8df..1414cd4 100644
--- a/src/@dseries/tex_rename.m
+++ b/src/@dseries/tex_rename.m
@@ -31,7 +31,7 @@ end
 
 assert(ischar(newtexname) || (iscellstr(newtexname) && length(newtexname) == vobs(ts)), ...
        ['dseries::tex_rename: third input argument (newtexname) name must either be a string' ...
-            ' or a cell array of strings with the same number of entries as varibles in the dseries']);
+        ' or a cell array of strings with the same number of entries as varibles in the dseries']);
 
 if nargin == 2
     idname = 1;
diff --git a/src/@dseries/vertcat.m b/src/@dseries/vertcat.m
index 387885a..d77e89e 100644
--- a/src/@dseries/vertcat.m
+++ b/src/@dseries/vertcat.m
@@ -7,7 +7,7 @@ function a = vertcat(varargin) % --*-- Unitary tests --*--
 %! Method of the dseries class.
 %! @sp 1
 %! This method overloads the vertical concatenation operator, so that
-%! two (or more) time series objects containing the same variables 
+%! two (or more) time series objects containing the same variables
 %! can be merged using the following syntax:
 %!
 %!     a = [b; c; d];
@@ -59,29 +59,29 @@ elseif nargin>1
 end
 
 function d = vertcat_(b, c)
-    d = NaN;
-    if ~isequal(frequency(b), frequency(c))
-        error('dseries::vertcat: Frequencies must be common!')
-    end
-    if ~isequal(vobs(b), vobs(c))
-        error('dseries::vertcat: Number of variables must be common!')
-    end
-    reorder_variables_in_c = false;
-    if ~isequal(b.name, c.name)
-        [t, idx] = ismember(b.name, c.name);
-        if all(t)
-            reorder_variables_in_c = true;
-        else
-            error('dseries::vertcat: Variables must be common!')
-        end
-    end
-    d = b;
-    if reorder_variables_in_c
-        d.data = [b.data; c.data(:,idx)];
+d = NaN;
+if ~isequal(frequency(b), frequency(c))
+    error('dseries::vertcat: Frequencies must be common!')
+end
+if ~isequal(vobs(b), vobs(c))
+    error('dseries::vertcat: Number of variables must be common!')
+end
+reorder_variables_in_c = false;
+if ~isequal(b.name, c.name)
+    [t, idx] = ismember(b.name, c.name);
+    if all(t)
+        reorder_variables_in_c = true;
     else
-        d.data = [b.data; c.data];
+        error('dseries::vertcat: Variables must be common!')
     end
-    d.dates = [b.dates; c.dates];
+end
+d = b;
+if reorder_variables_in_c
+    d.data = [b.data; c.data(:,idx)];
+else
+    d.data = [b.data; c.data];
+end
+d.dates = [b.dates; c.dates];
 
 %@test:1
 %$ % Define a data set.
diff --git a/src/read/load_csv_file_data.m b/src/read/load_csv_file_data.m
index 3a65360..32b6b52 100644
--- a/src/read/load_csv_file_data.m
+++ b/src/read/load_csv_file_data.m
@@ -2,16 +2,16 @@ function [freq, init, data, varlist] = load_csv_file_data(file) % --*-- Unitary
 %function [freq, init, data, varlist] = load_csv_file_data(file)
 % Loads data in a csv file.
 %
-% INPUTS 
+% INPUTS
 %  o file        string, name of the csv file (with path).
 %
-% OUTPUTS 
+% OUTPUTS
 %  o freq        integer scalar equal to 1, 4, 12 or 52 (for annual, quaterly, monthly or weekly frequencies).
 %  o init        dates object, initial date in the dataset.
 %  o data        matrix of doubles, the data.
 %  o varlist     cell of strings, names of the variables.
 %
-% REMARKS 
+% REMARKS
 %  The varlist output will be set only if the first line contains variable
 %  names. Similarly, if the first column does not contain dates, then
 %  freq will be 1 and init will be year 1.
diff --git a/src/read/load_m_file_data.m b/src/read/load_m_file_data.m
index cc72471..1be2c26 100644
--- a/src/read/load_m_file_data.m
+++ b/src/read/load_m_file_data.m
@@ -2,18 +2,18 @@ function [freq,init,data,varlist,tex] = load_m_file_data(file)
 
 % Loads data in a matlab/octave script.
 %
-% INPUTS 
+% INPUTS
 %  o file         string, name of the matlab/octave script (with path)
 %
-% OUTPUTS 
+% OUTPUTS
 %  o freq        integer scalar equal to 1, 4, 12 or 52 (for annual, quaterly, monthly or weekly frequencies).
 %  o init        dates object, initial date in the dataset.
 %  o data        matrix of doubles, the data.
 %  o varlist     cell of strings, names of the variables.
 %
-% REMARKS 
-% The frequency and initial date can be specified with variables FREQ__ and INIT__ in the matlab/octave script. FREQ__ must 
-% be a scalar integer and INIT__ a string like '1938M11', '1945Q3', '1973W3' or '2009A'. If these variables are not specified 
+% REMARKS
+% The frequency and initial date can be specified with variables FREQ__ and INIT__ in the matlab/octave script. FREQ__ must
+% be a scalar integer and INIT__ a string like '1938M11', '1945Q3', '1973W3' or '2009A'. If these variables are not specified
 % default values for freq and init are 1 and dates(1,1).
 
 % Copyright (C) 2012-2015 Dynare Team
@@ -94,7 +94,7 @@ if isempty(varlist0)
                 || isequal(list_of_variables(current_variable_index).name,'varlist0') ...
                 || isequal(list_of_variables(current_variable_index).name,'list_of_variables') ...
                 || isequal(list_of_variables(current_variable_index).name,'tex') ...
-            continue
+                continue
         end
         if list_of_variables(current_variable_index).global || list_of_variables(current_variable_index).persistent
             % A variable cannot be a global or persistent variable.
@@ -117,7 +117,7 @@ if isempty(varlist0)
     end
 else
     for current_variable_index=1:length(varlist0)
-       eval(['data = [data, ' varlist0{current_variable_index} '];'])
+        eval(['data = [data, ' varlist0{current_variable_index} '];'])
     end
     varlist = varlist0;
 end
diff --git a/src/read/load_mat_file_data.m b/src/read/load_mat_file_data.m
index d839956..8f12c7a 100644
--- a/src/read/load_mat_file_data.m
+++ b/src/read/load_mat_file_data.m
@@ -2,18 +2,18 @@ function [freq,init,data,varlist,tex] = load_mat_file_data(file)  % --*-- Unitar
 
 % Loads data in a matlab/octave mat-file.
 %
-% INPUTS 
+% INPUTS
 %  o file         string, name of the matlab/octave mat file (with path)
 %
-% OUTPUTS 
+% OUTPUTS
 %  o freq        integer scalar equal to 1, 4, 12 or 52 (for annual, quaterly, monthly or weekly frequencies).
 %  o init        dates object, initial date in the dataset.
 %  o data        matrix of doubles, the data.
 %  o varlist     cell of strings, names of the variables.
 %
-% REMARKS 
-% The frequency and initial date can be specified with variables FREQ__ and INIT__ in the matlab/octave binary file. FREQ__ must 
-% be a scalar integer and INIT__ a string like '1938M11', '1945Q3', '1973W3' or '2009A'. If these variables are not specified 
+% REMARKS
+% The frequency and initial date can be specified with variables FREQ__ and INIT__ in the matlab/octave binary file. FREQ__ must
+% be a scalar integer and INIT__ a string like '1938M11', '1945Q3', '1973W3' or '2009A'. If these variables are not specified
 % default values for freq and init are 1 and dates(1,1).
 
 % Copyright (C) 2012-2017 Dynare Team
diff --git a/src/read/load_xls_file_data.m b/src/read/load_xls_file_data.m
index 143e58a..439056d 100644
--- a/src/read/load_xls_file_data.m
+++ b/src/read/load_xls_file_data.m
@@ -2,18 +2,18 @@ function [freq, init, data, varlist] = load_xls_file_data(file, sheet, range)
 
 % Loads data in a xls file.
 %
-% INPUTS 
+% INPUTS
 %  o file       string, name of the file (with extension).
 %  o sheet      string, name of the sheet to be read.
 %  o range      string of the form 'B2:D6'
 %
-% OUTPUTS 
+% OUTPUTS
 %  o freq       integer scalar (1, 4, 12 or 52), code for frequency.
 %  o init       dates object, initial date of the sample.
 %  o data       matrix of doubles, the raw data.
 %  o varlist    cell of strings (column), names of the variables in the database.
 %
-% REMARKS 
+% REMARKS
 %  The range argument is only available on windows platform (with Excel installed).
 
 % Copyright (C) 2013-2015 Dynare Team
@@ -45,13 +45,13 @@ if nargin<3 || isempty(range)
 end
 
 if isoctave && ~user_has_octave_forge_package('io')
-  try
-    pkg load io
-  catch
-    error(['The io package is required to read CSV files from Octave. ' ...
-             'It can be installed by running the following from the Octave ' ...
-             ' command line: pkg install -forge io']);
-  end
+    try
+        pkg load io
+    catch
+        error(['The io package is required to read CSV files from Octave. ' ...
+               'It can be installed by running the following from the Octave ' ...
+               ' command line: pkg install -forge io']);
+    end
 end
 
 % Check file extension.
@@ -87,18 +87,18 @@ if isequal(t1,0) && isequal(t2,0)
     notime = 1;
     noname = 1;
 elseif isequal(t2,1) && t1>=t2 && n2~=t2  %only one column present, but no var name in header text
-    % The file contains no informations about the dates.
+                                          % The file contains no informations about the dates.
     notime = 0;
     noname = 1;
 elseif isequal(t2,1) && t1>=t2 && n2==t2 %only one column present with var name in header text
-    % The file contains no informations about the variables.
+                                         % The file contains no informations about the variables.
     notime = 1;
     noname = 0;
 elseif isequal(t1,1) && t2>=t1
     % The file contains no informations about the dates.
     notime = 1;
     noname = 0;
-else 
+else
     % The file contains informations about the variables and dates.
     notime = 0;
     noname = 0;
@@ -135,7 +135,7 @@ if ~noname
     else
         varlist = transpose(txt(1,2:end));
     end
-    % Remove leading and trailing white spaces 
+    % Remove leading and trailing white spaces
     for i=1:length(varlist)
         varlist(i) = {strtrim(varlist{i})};
     end
diff --git a/src/utilities/file/check_file_extension.m b/src/utilities/file/check_file_extension.m
index 7010701..472b0ae 100644
--- a/src/utilities/file/check_file_extension.m
+++ b/src/utilities/file/check_file_extension.m
@@ -3,11 +3,11 @@ function b = check_file_extension(file,type)
 % Check file extension of a file. Returns 1 (true) if the extension of ```file``` is equal to
 % ```type```, 0 (false) otherwise.
 %
-% INPUTS 
+% INPUTS
 % - file [str] file name.
 % - type [str] file extension.
 %
-% OUTPUTS 
+% OUTPUTS
 % - b [bool]
 
 
diff --git a/src/utilities/from/from.m b/src/utilities/from/from.m
index feb2a80..0b8a0c7 100644
--- a/src/utilities/from/from.m
+++ b/src/utilities/from/from.m
@@ -281,7 +281,7 @@ end
 % Put all the variables in a unique dseries object.
 list_of_variables = leadlagtable{1,1};
 for i=2:number_of_variables
-   list_of_variables = [list_of_variables, ',' leadlagtable{i,1}];
+    list_of_variables = [list_of_variables, ',' leadlagtable{i,1}];
 end
 eval(sprintf('tmp = [%s];', list_of_variables));
 
@@ -376,52 +376,52 @@ else
 end
 
 function msg = get_error_message_0(msg)
-    if ~nargin
-        msg = sprintf('Wrong syntax! The correct syntax is:\n\n');
-    else
-        msg = [msg, sprintf('The correct syntax is:\n\n')];
-    end
-    msg = [msg, sprintf('    from d1 to d2 do SOMETHING\n\n')];
-    msg = [msg, sprintf('where d1<d2 are dates objects, and SOMETHING is a recursive expression involving dseries objects.')];
+if ~nargin
+    msg = sprintf('Wrong syntax! The correct syntax is:\n\n');
+else
+    msg = [msg, sprintf('The correct syntax is:\n\n')];
+end
+msg = [msg, sprintf('    from d1 to d2 do SOMETHING\n\n')];
+msg = [msg, sprintf('where d1<d2 are dates objects, and SOMETHING is a recursive expression involving dseries objects.')];
 
 
 function index = extractindex(str)
-    index = regexpi(str,'\(t\)|\(t\-\d\)|\(t\+\d\)','match');
+index = regexpi(str,'\(t\)|\(t\-\d\)|\(t\+\d\)','match');
 
 
 function i = index2num(id)
-    if isequal('(t)',id)
-        i = 0;
-        return
-    end
-    if isequal('-',id(3))
-        i = - str2num(id(4:end-1));
-    else
-        i = str2num(id(4:end-1));
-    end
+if isequal('(t)',id)
+    i = 0;
+    return
+end
+if isequal('-',id(3))
+    i = - str2num(id(4:end-1));
+else
+    i = str2num(id(4:end-1));
+end
 
 
 function id = num2index(i)
-    if isequal(i,0)
-        id = '(t)';
-        return
-    end
-    if i<0
-        id = ['(t-' int2str(abs(i)) ')'];
-    else
-        id = ['(t+' int2str(i) ')'];
-    end
+if isequal(i,0)
+    id = '(t)';
+    return
+end
+if i<0
+    id = ['(t-' int2str(abs(i)) ')'];
+else
+    id = ['(t+' int2str(i) ')'];
+end
 
 function i = isassignedvariable(var,expr)
-    idv = strfind(expr,var);
-    idq = strfind(expr,'=');
-    if ~isempty(idv)
-        if idv(1)<idq
-            i = 1;
-            return
-        end
+idv = strfind(expr,var);
+idq = strfind(expr,'=');
+if ~isempty(idv)
+    if idv(1)<idq
+        i = 1;
+        return
     end
-    i = 0;
+end
+i = 0;
 
 %@test:1
 %$ try
diff --git a/src/utilities/insert/insert_column_vector_in_a_matrix.m b/src/utilities/insert/insert_column_vector_in_a_matrix.m
index 1188424..c9736ce 100644
--- a/src/utilities/insert/insert_column_vector_in_a_matrix.m
+++ b/src/utilities/insert/insert_column_vector_in_a_matrix.m
@@ -2,12 +2,12 @@ function matrix = insert_column_vector_in_a_matrix(matrix, vector, i)  % --*-- U
 
 % Inserts a vector in a matrix in a column specified by i.
 %
-% INPUTS 
+% INPUTS
 % - matrix [float]   n*m matrix.
 % - vector [float]   n*1 vector.
 % - i      [integer] scalar between 1 and m+1. Default value is m+1.
 %
-% OUTPUTS 
+% OUTPUTS
 % - matrix [float]   n*(m+1) matrix.
 
 % Copyright (C) 2013-2015 Dynare Team
diff --git a/src/utilities/insert/insert_object_in_a_one_dimensional_cell_array.m b/src/utilities/insert/insert_object_in_a_one_dimensional_cell_array.m
index c8ce663..43c466e 100644
--- a/src/utilities/insert/insert_object_in_a_one_dimensional_cell_array.m
+++ b/src/utilities/insert/insert_object_in_a_one_dimensional_cell_array.m
@@ -2,12 +2,12 @@ function one_dimensional_cell_array = insert_object_in_a_one_dimensional_cell_ar
 
 % Inserts an object in a one dimensional cell array in a position specified by i.
 %
-% INPUTS 
+% INPUTS
 % - one_dimensional_cell_array [any]     cell array with n objects.
 % - object                     [any]     scalar object.
 % - i                          [integer] scalar between 1 and n+1. Default value is m+1.
 %
-% OUTPUTS 
+% OUTPUTS
 % - one_dimensional_cell_array [any]     cell array with n+1 elements.
 
 % Copyright (C) 2013-2015 Dynare Team
diff --git a/src/utilities/insert/replace_object_in_a_one_dimensional_cell_array.m b/src/utilities/insert/replace_object_in_a_one_dimensional_cell_array.m
index b5fcfff..5e545c2 100644
--- a/src/utilities/insert/replace_object_in_a_one_dimensional_cell_array.m
+++ b/src/utilities/insert/replace_object_in_a_one_dimensional_cell_array.m
@@ -2,12 +2,12 @@ function one_dimensional_cell_array = replace_object_in_a_one_dimensional_cell_a
 
 % Replaces an object in a one dimensional cell array in a position specified by i.
 %
-% INPUTS 
+% INPUTS
 % - one_dimensional_cell_array [any]     cell array with n objects.
 % - object                     [any]     scalar object.
 % - i                          [integer] scalar between 1 and n.
 %
-% OUTPUTS 
+% OUTPUTS
 % - one_dimensional_cell_array [any]     cell array with n+1 elements.
 
 % Copyright (C) 2013-2015 Dynare Team
diff --git a/src/utilities/is/iscellofchar.m b/src/utilities/is/iscellofchar.m
index a9100f6..c6185af 100644
--- a/src/utilities/is/iscellofchar.m
+++ b/src/utilities/is/iscellofchar.m
@@ -2,10 +2,10 @@ function a = iscellofchar(b)
 
 % Returns true iff ```b``` is a cell of char.
 %
-% INPUTS 
+% INPUTS
 % - b [any]
 %
-% OUTPUTS 
+% OUTPUTS
 % - a [bool]
 
 % Copyright (C) 2012-2015 Dynare Team
diff --git a/src/utilities/is/isglobalinbase.m b/src/utilities/is/isglobalinbase.m
index 8280ac6..6466d86 100644
--- a/src/utilities/is/isglobalinbase.m
+++ b/src/utilities/is/isglobalinbase.m
@@ -2,10 +2,10 @@ function a = isglobalinbase(var)
 
 % Returns true iff ```var``` is a global variable in the main workspace.
 %
-% INPUTS 
+% INPUTS
 % - var [any]
 %
-% OUTPUTS 
+% OUTPUTS
 % - a   [bool]
 
 % Copyright (C) 2013-2015 Dynare Team
diff --git a/src/utilities/missing/demean/demean.m b/src/utilities/missing/demean/demean.m
index bcfa3b5..8e77f55 100644
--- a/src/utilities/missing/demean/demean.m
+++ b/src/utilities/missing/demean/demean.m
@@ -2,10 +2,10 @@ function c = demean(x)
 
 % Removes the mean of each column of a matrix.
 %
-% INPUTS 
+% INPUTS
 % - x  [float] T*n matrix.
 %
-% OUTPUTS 
+% OUTPUTS
 % - c  [float] T*n matrix, the demeaned matrix x.
 
 % Copyright (C) 2011-2015 Dynare Team
diff --git a/src/utilities/missing/ndim/ndim.m b/src/utilities/missing/ndim/ndim.m
index dc62e80..601d66c 100644
--- a/src/utilities/missing/ndim/ndim.m
+++ b/src/utilities/missing/ndim/ndim.m
@@ -2,10 +2,10 @@ function n = ndim(x)
 
 % Returns the number of non singleton dimensions of a matlab array.
 %
-% INPUTS 
+% INPUTS
 % - x  [array]
 %
-% OUTPUTS 
+% OUTPUTS
 % - n  [integer] number of non singleton dimensions.
 
 % Copyright (C) 2012-2015 Dynare Team
diff --git a/src/utilities/missing/sample_hp_filter/sample_hp_filter.m b/src/utilities/missing/sample_hp_filter/sample_hp_filter.m
index 77dddb8..c08f5f9 100644
--- a/src/utilities/missing/sample_hp_filter/sample_hp_filter.m
+++ b/src/utilities/missing/sample_hp_filter/sample_hp_filter.m
@@ -2,11 +2,11 @@ function [hptrend,hpcycle] = sample_hp_filter(y,s)
 
 % HP filters a collection of time series.
 %
-% INPUTS 
+% INPUTS
 %   y                        [double]   T*n matrix of data (n is the number of variables)
 %   s                        [double]   scalar, smoothing parameter.
 %
-% OUTPUTS 
+% OUTPUTS
 %   hptrend                  [double]   T*n matrix, trend component of y.
 %   hpcycle                  [double]   T*n matrix, cycle component of y.
 
diff --git a/src/utilities/str/common_strings_in_cell_arrays.m b/src/utilities/str/common_strings_in_cell_arrays.m
index 724183f..f182656 100644
--- a/src/utilities/str/common_strings_in_cell_arrays.m
+++ b/src/utilities/str/common_strings_in_cell_arrays.m
@@ -2,11 +2,11 @@ function [n,message] = common_strings_in_cell_arrays(a,b)
 
 % Counts the number of common strings in two cell arrays of strings ```a``` and ```b```.
 %
-% INPUTS 
+% INPUTS
 % - a [cell] One dimensional cell array of strings.
 % - b [cell] One dimensional cell array of strings.
 %
-% OUTPUTS 
+% OUTPUTS
 % - n         [integer] scalar, the number of common strings.
 % - message   [string]  formatted list of common strings.
 
@@ -107,4 +107,3 @@ end
 %$ end
 %$ T = all(t);
 %@eof:3
-
diff --git a/src/utilities/str/get_random_string.m b/src/utilities/str/get_random_string.m
index 44a45f4..cac13f3 100644
--- a/src/utilities/str/get_random_string.m
+++ b/src/utilities/str/get_random_string.m
@@ -2,10 +2,10 @@ function s = get_random_string(n);
 
 % Builds a random string (starting with a letter).
 %
-% INPUTS 
+% INPUTS
 % - n [integer] scalar, length of the generated string.
 %
-% OUTPUTS 
+% OUTPUTS
 % - s [string] random string of length n.
 
 % Copyright (C) 2012-2015 Dynare Team
diff --git a/src/utilities/str/name2tex.m b/src/utilities/str/name2tex.m
index 3ce3575..d9e7946 100644
--- a/src/utilities/str/name2tex.m
+++ b/src/utilities/str/name2tex.m
@@ -4,11 +4,11 @@ function tex = name2tex(name, info) % --*-- Unitary tests --*--
 %
 % Builds a random string (starting with a letter).
 %
-% INPUTS 
+% INPUTS
 % - name [string or cell of strings] name(s) to be converted.
 % - info [integer] scalar equal to 0 or 1 (adds curly braces for indices).
 %
-% OUTPUTS 
+% OUTPUTS
 % - tex  [string or cell of strings]
 
 % Copyright (C) 2012-2016 Dynare Team
diff --git a/src/utilities/variables/build_list_of_variables_with_loops.m b/src/utilities/variables/build_list_of_variables_with_loops.m
index 4756209..5439f27 100644
--- a/src/utilities/variables/build_list_of_variables_with_loops.m
+++ b/src/utilities/variables/build_list_of_variables_with_loops.m
@@ -18,7 +18,7 @@ function list_of_variables = build_list_of_variables_with_loops(o_list_of_variab
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
 checknames = ~isempty(o_list_of_variables);
-    
+
 NumberOfImplicitLoops = .5*length(idArobase);
 
 idComma = cell(NumberOfImplicitLoops,1);
@@ -39,7 +39,7 @@ switch NumberOfImplicitLoops
     expression = expressions{1};
     idVariables_ = [];
     while ~isempty(expression)
-        [token, expression] = strtok(expression,',');             
+        [token, expression] = strtok(expression,',');
         candidate = [VariableName(1:idArobase(1)-1), token, VariableName(idArobase(2)+1:end)];
         if checknames
             id = find(strcmp(candidate,o_list_of_variables));
diff --git a/src/utilities/variables/build_list_of_variables_with_regexp.m b/src/utilities/variables/build_list_of_variables_with_regexp.m
index 90d76c9..d1c184c 100644
--- a/src/utilities/variables/build_list_of_variables_with_regexp.m
+++ b/src/utilities/variables/build_list_of_variables_with_regexp.m
@@ -47,10 +47,10 @@ list_of_variables = vertcat(list_of_variables, VariableName);
 
 
 function b = isnotempty_cell(CellArray)
-    CellArrayDimension = size(CellArray);
-    b = NaN(CellArrayDimension);
-    for i=1:CellArrayDimension(1)
-        for j = 1:CellArrayDimension(2)
-            b(i,j) = ~isempty(CellArray{i,j});
-        end
+CellArrayDimension = size(CellArray);
+b = NaN(CellArrayDimension);
+for i=1:CellArrayDimension(1)
+    for j = 1:CellArrayDimension(2)
+        b(i,j) = ~isempty(CellArray{i,j});
     end
+end
-- 
GitLab