ver

Version information for MathWorks products

Syntax

  • product_info = ver(product) example

Description

example

ver displays:

  • A header containing the current MATLAB® product family version number, license number, operating system, and version of Java® software for the MATLAB product.

  • The version numbers for MATLAB and all other installed MathWorks® products.

example

ver product displays, in addition to the header information:

  • The current version number for product, where product is the name of the folder that contains the Contents.m file for the product you are inquiring about.

example

product_info = ver(product) returns product information to the structure array, product_info.

Examples

expand all

Version for All Installed Products

Display version information for all installed products. The output shown here is representative. Your results may differ.

ver
-------------------------------------------------------------------------------------------------------
MATLAB Version: 8.2.0.29 (R2013b)
MATLAB License Number: 234567
Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------------------------
MATLAB                                                Version 8.2        (R2013b)             
Simulink                                              Version 8.2        (R2013b)      
Control System Toolbox                                Version 9.6        (R2013b)       

Version for a Particular Product

Display version information for MATLAB and the Control System Toolbox™ product. The output shown here is representative. Your results may differ.

1. Determine the product name for Control System Toolbox by setting n to the name of a function unique to Control System Toolbox, such as dss:

n = 'dss';
pat = '(?<=^.+[\\/]toolbox[\\/])[^\\/]+';
regexp(which(n), pat, 'match', 'once')
ans=
control

2. Specify the value returned in the previous step as an argument to ver:

ver control
----------------------------------------------------------------------------------------------------
MATLAB Version: 8.2.0.29 (R2013b)
MATLAB License Number: 234567
Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
Control System Toolbox                                Version 9.6        (R2013b) 

Structure Containing Version for the MATLAB family of products

Create a structure containing version information, and then display the structure values. The output shown here is representative. Your results may differ.

v = ver;
for k = 1:length(v)
  fprintf('%s\n', v(k).Name);
  fprintf('  Version: %s\n', v(k).Version);
end
MATLAB
 Version: 8.2

MATLAB Builder JA
 Version: 2.3

MATLAB Builder NE
 Version: 4.2

MATLAB Compiler
 Version: 5.0

My Custom Toolbox
 Version: 1.0

Structure Containing Version for a Particular Product

Create a structure containing version information for just the Symbolic Math Toolbox™ product. The output shown here is representative. Your results may differ.

1. Determine the product name for Symbolic Math Toolbox by setting n to the name of a function unique to Symbolic Math Toolbox, such as sym:

n = 'sym';
pat = '(?<=^.+[\\/]toolbox[\\/])[^\\/]+';
regexp(which(n), pat, 'match', 'once')
ans =

symbolic

2. Specify the value returned in the previous step as an argument to ver:

v = ver('symbolic')
v = 

        Name: 'Symbolic Math Toolbox'
     Version: '5.11'
     Release: '(R2013b)'
        Date: '19-May-2013'   

Input Arguments

expand all

product — product-specific informationstring

The product or toolbox for which you want to view version information, specified as a string.

To determine the string to use, run the following code, substituting the name of a product function for toolbxfcn:

n = 'toolbxfcn';
pat = '(?<=^.+[\\/]toolbox[\\/])[^\\/]+';
regexp(which(n), pat, 'match', 'once')

Output Arguments

expand all

product_info — product name, version, release, and datestructure array

Product name, version, release, and date, returned as a structure array with these fields: Name, Version, Release, and Date. If a license is a trial version, the value in the Version field is preceded by the letter T

Was this topic helpful?