Main Content

isMATLABReleaseOlderThan

Determine if current MATLAB release is older than specified MATLAB release

Since R2020b. Recommended over verLessThan.

Description

example

tf = isMATLABReleaseOlderThan(release) returns logical 1 (true) if the current MATLAB® release is older than release and logical 0 (false) otherwise.

tf = isMATLABReleaseOlderThan(release,stage) returns logical 1 (true) if the current MATLAB release is older than the stage of the release and logical 0 (false) otherwise.

tf = isMATLABReleaseOlderThan(release,stage,update) returns logical 1 (true) if the current MATLAB release is older than the specified update number of the stage of the release and logical 0 (false) otherwise.

Examples

collapse all

Use isMATLABReleaseOlderThan to check whether the current version of MATLAB is older than a specified version.

Display the current release of MATLAB using matlabRelease.

currentRelease = matlabRelease
currentRelease = 
  matlabRelease with properties:

    Release: "R2020b"
      Stage: "release"
     Update: 0
       Date: 09-Sept-2020

Use isMATLABReleaseOlderThan to check whether the current release is older than "R2020a".

tf = isMATLABReleaseOlderThan("R2020a")
tf = logical
   0

It is also possible to check whether the current release is older than a given stage or update number.

tf = isMATLABReleaseOlderThan("R2021a","release")
tf = logical
   1

tf = isMATLABReleaseOlderThan("R2020b","release",1)
tf = logical
   1

Input Arguments

collapse all

MATLAB release version, specified as a string scalar or character vector. release must match the full name MATLAB release version. For example, "R2020b" is a valid input, but "20b" is not and throws an error.

Example: tf = isMATLABReleaseOlderThan("R2020b")

MATLAB release stage, specified as "release" or "prerelease".

Example: tf = isMATLABReleaseOlderThan("R2020b","release")

MATLAB release update number, specified as a numeric scalar.

Example: tf = isMATLABReleaseOlderThan("R2020b","release",2)

Version History

Introduced in R2020b