Home > matpower7.1 > mptest > lib > have_feature_matlab.m

have_feature_matlab

PURPOSE ^

HAVE_FEATURE_MATLAB Detect availability/version info for MATLAB

SYNOPSIS ^

function [TorF, vstr, rdate] = have_feature_matlab()

DESCRIPTION ^

HAVE_FEATURE_MATLAB  Detect availability/version info for MATLAB

   Feature detection function implementing 'matlab' tag for HAVE_FEATURE
   to detect whether code is running under MATLAB.

   See also HAVE_FEATURE.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [TorF, vstr, rdate] = have_feature_matlab()
0002 %HAVE_FEATURE_MATLAB  Detect availability/version info for MATLAB
0003 %
0004 %   Feature detection function implementing 'matlab' tag for HAVE_FEATURE
0005 %   to detect whether code is running under MATLAB.
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 v = ver('matlab');
0018 if length(v) > 1
0019     warning('The built-in VER command is behaving strangely, probably as a result of installing a 3rd party toolbox in a directory named ''matlab'' on your path. Check each element of the output of ver(''matlab'') to find the offending toolbox, then move the toolbox to a more appropriately named directory.');
0020     v = v(1);
0021 end
0022 if ~isempty(v) && isfield(v, 'Version') && ~isempty(v.Version)
0023     TorF = 1;
0024     vstr = v.Version;
0025     rdate = v.Date;
0026 else
0027     TorF = 0;
0028     vstr = '';
0029     rdate = '';
0030 end

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005