vernum.m
No License
vernum - returns the current version of Matlab as a number
30 June 2006 - Created
by David S. Ciochetto and Audrey Barnett, Dalhousie Oceanography
30 June 2006 (Last modified) by David S. Ciochetto
This function gets the current version of matlab and converts it to a real number through the first decimal point. It is intended to be used to delimit cases where code is specific to particular Matlab versions. It is particularly useful for < or > a specific version such as when someone writes to you and says hey, this does not work for Matlab 3... you can use vernum in your code to add a patch with case or if statements to write code that works for the older versions.
It is intended to make detection of the version automatic in your code so it keeps the users of your scripts happy since they do not need to go in and fix the code for their specific version.
Example
if vernum < 7.1 % The below works for Matlab versions earlier than 7.1
% Add code
else % works for newer code
% Add fancy code here
end
Cite As
Dave Ciochetto (2026). vernum.m (https://www.mathworks.com/matlabcentral/fileexchange/11602-vernum-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | Add a ';' to prevent unwanted output to screen. |
