verLessThanFS

verLessThanFS compares version of MATLAB to specified version number

Syntax

• result=verLessThanFS(vernumber)example

Description

function verLessThanFS is much faster than verLessThan because it just checks the version of MATLAB and calls directly the relevant built in functions. The number containing the MATLAB version is cached for better performance. In order words, the first time verLessThanFS is called the vector with two numbers associated to the MATLAB version is stored in persistent variable named cachedMatlabVerFS.

 result =verLessThanFS(vernumber) Test whether the current version is older than MATLAB version 8.4.

Examples

expand all

Test whether the current version is older than MATLAB version 8.4.

In this case the input argument is a scalar double

numbertotest = 8.4;
out=verLessThanFS(numbertotest);
if out == true
disp(['current version is older than ' num2str(numbertotest)]);
else
disp(['current version is not older than ' num2str(numbertotest)]);
end

Related Examples

expand all

In this case the input argument is a vector with two elements Test whether the current version is older than MATLAB version 9.

10.

% Note that when the minor revision to test is greater than 2 it is necessary
% to use a vector with two elements.
numbertotest = [9 10];
out=verLessThanFS(numbertotest);
if out == true
disp(['current version is older than ' num2str(numbertotest)]);
else
disp(['current version is not older than ' num2str(numbertotest)]);
end

Test whether the current version is older than MATLAB version 9.

12 In this case the input argument is a vector with two elements

numbertotest = '9.11';
out=verLessThanFS(numbertotest);
if out == true
disp(['current version is older than ' num2str(numbertotest)]);
else
disp(['current version is not oder than ' num2str(numbertotest)]);
end

Input Arguments

vernumber — version of MATLAB to test. scalar double or character or vector of doubles.

Number containing the version of MATLAB to test again current version. If version is a character, it must be in the format major.minor.revision or major.minor.

If version is a scalar double what is before the full stop is the major revision and the FIRST number after the full stop is the minor revision. If version is a vector of doubles the first element is the major revision and the second element is the minor revision.

REMARK: Note that this function only considers major and minor version and not the revision version.

Example - 8.3 or [8 3] or '8.3'

Data Types: double

Output Arguments

result —True or false. Boolean

result is true if the current version of version of MATLAB is older than the version specified by vernumber, and false otherwise.