From 2f2ada121a82d8ff31f0bee819421cbb7a01baa9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 3 Feb 2014 15:50:00 +0100
Subject: [PATCH] Fix test for availability of xlswrite. (cherry picked from
 commit 6d1ee23437e898f09bfb4e0fb5bcfc3d52a0efda)

---
 matlab/writedata.m | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/matlab/writedata.m b/matlab/writedata.m
index 815563008..112d7f130 100644
--- a/matlab/writedata.m
+++ b/matlab/writedata.m
@@ -10,7 +10,7 @@ function writedata(fname)
 % SPECIAL REQUIREMENT
 %   none
 
-% Copyright (C) 2007-2009 Dynare Team
+% Copyright (C) 2007-2014 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -29,9 +29,8 @@ function writedata(fname)
 
 global M_ oo_
 
-% xlswrite doesn't exist on Octave, and appeared in MATLAB 7.0
-if isoctave || matlab_ver_less_than('7.0')
-    error('Function not supported on your version of MATLAB or Octave')
+if isoctave && ~user_has_octave_forge_package('io')
+    error('The io package is required to write XLS files from Octave')
 end
 
 S=[fname '_endo.xls'];
-- 
GitLab