From 99e4cb6e7e18385c5ef8ab7fc74ac40207ce9940 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Fri, 1 Dec 2017 13:48:13 +0100
Subject: [PATCH] evaluate_steady_state_file.m: Condition call to str2func on
 function being present

Workaround for Octave bug https://savannah.gnu.org/bugs/?52568
---
 matlab/evaluate_steady_state_file.m | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/matlab/evaluate_steady_state_file.m b/matlab/evaluate_steady_state_file.m
index 104ae71e5..cecf3ec50 100644
--- a/matlab/evaluate_steady_state_file.m
+++ b/matlab/evaluate_steady_state_file.m
@@ -70,7 +70,9 @@ else
     updated_params_flag = 0;
 end
 
-h_set_auxiliary_variables = str2func([M.fname '_set_auxiliary_variables']);
+if M.set_auxiliary_variables %otherwise Octave may crash, see https://savannah.gnu.org/bugs/?52568
+    h_set_auxiliary_variables = str2func([M.fname '_set_auxiliary_variables']);
+end
 if  isnan(updated_params_flag) || (updated_params_flag  && any(isnan(params(~isnan(params))-params1(~isnan(params))))) %checks if new NaNs were added
     info(1) = 24;
     info(2) = NaN;
-- 
GitLab