HAVE_FEATURE_OCTAVE Detect availability/version info for Octave Feature detection function implementing 'octave' tag for HAVE_FEATURE to detect whether code is running under GNU Octave. See also HAVE_FEATURE.
0001 function [TorF, vstr, rdate] = have_feature_octave() 0002 %HAVE_FEATURE_OCTAVE Detect availability/version info for Octave 0003 % 0004 % Feature detection function implementing 'octave' tag for HAVE_FEATURE 0005 % to detect whether code is running under GNU Octave. 0006 % 0007 % See also HAVE_FEATURE. 0008 0009 % MP-Test 0010 % Copyright (c) 2004-2020, Power Systems Engineering Research Center (PSERC) 0011 % by Ray Zimmerman, PSERC Cornell 0012 % 0013 % This file is part of MP-Test. 0014 % Covered by the 3-clause BSD License (see LICENSE file for details). 0015 % See https://github.com/MATPOWER/mptest for more info. 0016 0017 TorF = exist('OCTAVE_VERSION', 'builtin') == 5; 0018 if TorF 0019 % v = ver('octave'); 0020 %% workaround for https://savannah.gnu.org/bugs/index.php?59125 0021 v = ver; 0022 for k = 1:length(v) 0023 if strcmp(v(k).Name, 'Octave') 0024 v = v(k); 0025 break; 0026 end 0027 end 0028 0029 vstr = v.Version; 0030 if ~isempty(v.Date) 0031 rdate = datestr(v.Date, 'dd-mmm-yyyy'); 0032 else 0033 rdate = ''; 0034 end 0035 else 0036 vstr = ''; 0037 rdate = ''; 0038 end