


function r = octave_ver_less_than(verstr)
Returns 1 if current Octave version is strictly older than
the one given in argument.
Note that this function will fail under Matlab.
INPUTS
verstr: a string of the format 'x.y' or 'x.y.z'
OUTPUTS
r: 0 or 1
SPECIAL REQUIREMENTS
none


0001 function r = octave_ver_less_than(verstr) 0002 % function r = octave_ver_less_than(verstr) 0003 % 0004 % Returns 1 if current Octave version is strictly older than 0005 % the one given in argument. 0006 % 0007 % Note that this function will fail under Matlab. 0008 % 0009 % INPUTS 0010 % verstr: a string of the format 'x.y' or 'x.y.z' 0011 % 0012 % OUTPUTS 0013 % r: 0 or 1 0014 % 0015 % SPECIAL REQUIREMENTS 0016 % none 0017 0018 % Copyright (C) 2008-2009 Dynare Team 0019 % 0020 % This file is part of Dynare. 0021 % 0022 % Dynare is free software: you can redistribute it and/or modify 0023 % it under the terms of the GNU General Public License as published by 0024 % the Free Software Foundation, either version 3 of the License, or 0025 % (at your option) any later version. 0026 % 0027 % Dynare is distributed in the hope that it will be useful, 0028 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0029 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0030 % GNU General Public License for more details. 0031 % 0032 % You should have received a copy of the GNU General Public License 0033 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0034 0035 cur_verstr = version(); 0036 0037 r = get_ver_numeric(cur_verstr) < get_ver_numeric(verstr); 0038 endfunction 0039 0040 function x = get_ver_numeric(verstr) 0041 nums = sscanf(verstr, '%d.%d.%d')'; 0042 if length(nums) < 3 0043 nums(3) = 0; 0044 end 0045 x = nums * [1; 0.01; 0.0001 ]; 0046 endfunction