diff --git a/src/@page/page.m b/src/@page/page.m
index 565c34ebeb960277f5a42a92665105c4b7f5a5ac..efbac2333534ac4d605c79430947626abe623eed 100644
--- a/src/@page/page.m
+++ b/src/@page/page.m
@@ -1,7 +1,7 @@
 classdef page < handle
     % page Class
     %
-    % Copyright (C) 2013-2019 Dynare Team
+    % Copyright (C) 2013-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -65,9 +65,13 @@ classdef page < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             % overwrite default values
             for pair = reshape(varargin, 2, [])
diff --git a/src/@paragraph/paragraph.m b/src/@paragraph/paragraph.m
index 85ff6b5d6ce2c443222de3e6c7d4c94f84d69c43..7ed293e5174950c5b1eda49228732ef6c63a92cc 100644
--- a/src/@paragraph/paragraph.m
+++ b/src/@paragraph/paragraph.m
@@ -1,7 +1,7 @@
 classdef paragraph < handle
     % paragraph Class
     %
-    % Copyright (C) 2014-2019 Dynare Team
+    % Copyright (C) 2014-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -54,9 +54,13 @@ classdef paragraph < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             for pair = reshape(varargin, 2, [])
                 ind = find(strcmpi(optNames, pair{1}));
diff --git a/src/@report/report.m b/src/@report/report.m
index 858d686ce97eddd21e3f547ea438cb772103fbe9..e97eb302bb3717be926fec38abd5132bf2d298a2 100644
--- a/src/@report/report.m
+++ b/src/@report/report.m
@@ -1,7 +1,7 @@
 classdef report < handle
     % report Class
     %
-    % Copyright (C) 2013-2019 Dynare Team
+    % Copyright (C) 2013-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -64,9 +64,13 @@ classdef report < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             % overwrite default values
             for pair = reshape(varargin, 2, [])
diff --git a/src/@report_data/report_data.m b/src/@report_data/report_data.m
index bdc0b8f2188511827e44d3cda451cff2b8ec6554..9e8d63dd22421815c533672aabf90a55b4fc88ce 100644
--- a/src/@report_data/report_data.m
+++ b/src/@report_data/report_data.m
@@ -1,7 +1,7 @@
 classdef report_data < handle
     % report_data Class to write a page to the report
     %
-    % Copyright (C) 2019 Dynare Team
+    % Copyright (C) 2019-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -57,9 +57,13 @@ classdef report_data < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             % overwrite default values
             for pair = reshape(varargin, 2, [])
diff --git a/src/@report_graph/report_graph.m b/src/@report_graph/report_graph.m
index 0cddf171dcd8352c2b48b077caa588cded5de753..ad6143eef9296d8efa2367d35db32afbcf9e5098 100644
--- a/src/@report_graph/report_graph.m
+++ b/src/@report_graph/report_graph.m
@@ -1,7 +1,7 @@
 classdef report_graph < handle
     % report_graph Class
     %
-    % Copyright (C) 2013-2020 Dynare Team
+    % Copyright (C) 2013-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -91,9 +91,13 @@ classdef report_graph < handle
                 end
 
                 % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-                warning('off')
+                if isoctave
+                    warnstate = warning('off', 'Octave:classdef-to-struct');
+                end
                 optNames = fieldnames(o);
-                warning('on')
+                if isoctave
+                    warning(warnstate);
+                end
 
                 % overwrite default values
                 for pair = reshape(varargin, 2, [])
diff --git a/src/@report_series/report_series.m b/src/@report_series/report_series.m
index bbd02fd83daa83bb7df61a6af6f1e66d524b73e3..daedc5bb4c23c6defa92e9e659008fdb7273a470 100644
--- a/src/@report_series/report_series.m
+++ b/src/@report_series/report_series.m
@@ -1,7 +1,7 @@
 classdef report_series < handle
     % report_series Class to write a page to the report
     %
-    % Copyright (C) 2013-2019 Dynare Team
+    % Copyright (C) 2013-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -79,9 +79,13 @@ classdef report_series < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             % overwrite default values
             for pair = reshape(varargin, 2, [])
diff --git a/src/@report_table/report_table.m b/src/@report_table/report_table.m
index 3df72d56a06875a461dbc0e3aebb85506c4f65c7..f6a334de6bb5b0727e836299a21094301415b178 100644
--- a/src/@report_table/report_table.m
+++ b/src/@report_table/report_table.m
@@ -1,7 +1,7 @@
 classdef report_table < handle
     % report_table Class
     %
-    % Copyright (C) 2013-2019 Dynare Team
+    % Copyright (C) 2013-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -73,9 +73,13 @@ classdef report_table < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             % overwrite default values
             for pair = reshape(varargin, 2, [])
diff --git a/src/@section/section.m b/src/@section/section.m
index cfd70afa4ab3f5573cac8bb2248dd56921cb76a6..52bfd45560bf9c6505060574ab6f3fc9609f84d9 100644
--- a/src/@section/section.m
+++ b/src/@section/section.m
@@ -1,7 +1,7 @@
 classdef section < handle
     % section Class
     %
-    % Copyright (C) 2013-2019 Dynare Team
+    % Copyright (C) 2013-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -53,9 +53,13 @@ classdef section < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             % overwrite default values
             for pair = reshape(varargin, 2, [])
diff --git a/src/@vspace/vspace.m b/src/@vspace/vspace.m
index 009a22dddb8345fabec89d92e63ba368b4e8ae07..73b670704e72dba077c6e4cfe727b2de2522adf4 100644
--- a/src/@vspace/vspace.m
+++ b/src/@vspace/vspace.m
@@ -1,7 +1,7 @@
 classdef vspace < handle
     % vspace Class
     %
-    % Copyright (C) 2013-2019 Dynare Team
+    % Copyright (C) 2013-2022 Dynare Team
     %
     % This file is part of Dynare.
     %
@@ -50,9 +50,13 @@ classdef vspace < handle
             end
 
             % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
-            warning('off')
+            if isoctave
+                warnstate = warning('off', 'Octave:classdef-to-struct');
+            end
             optNames = fieldnames(o);
-            warning('on')
+            if isoctave
+                warning(warnstate);
+            end
 
             % overwrite default values
             for pair = reshape(varargin, 2, [])