Be the first to rate this file! 100 downloads (last 30 days) File Size: 1.83 KB File ID: #17285

getversion: find MATLAB version number as a double

by Tim Davis

 

01 Nov 2007 (Updated 02 Nov 2007)

Code covered by BSD License  

Portable replacement for verLessThan on old MATLAB releases

Download Now | Watch this File

File Information
Description

getversion returns the MATLAB version number as a double, to allow inequality comparisons when checking for ranges of MATLAB versions. The major, sub, and sub-sub version numbers are returned (MATLAB '6.5.2.202935 (R13) Service Pack 2' returns 6.52).

This code is more portable than "ver" (which verLessThan uses) because it does not use structs. It should work on any MATLAB that has the version, sscanf, and length functions.

It has been tested on MATLAB 6.1, 6.5.2., 7.0.1, 7.0.4, 7.1, 7.2, 7.3, 7.4, and 7.5. I no longer have MATLAB 5.x or earlier; please notify me if you test it on those platforms.

See also ver, version, and verLessThan.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
vernum.m

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
02 Nov 2007

minor typo in description (no change to code)

Tag Activity for this File
Tag Applied By Date/Time
version Tim Davis 22 Oct 2008 09:33:26
ver Tim Davis 22 Oct 2008 09:33:26
verlessthan Tim Davis 22 Oct 2008 09:33:26
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com