Version number 2021a Version='9.10' is confusing. Why not using '10.0'

I used ver('MATLAB') in Matlab release 2021a and got
Name: 'MATLAB'
Version: '9.10'
Release: '(R2021a)'
Date: '14-Nov-2020'
The version string/number can be confusing because numerically 9.10 becomes 9.1 and 'feels' lower than the previous Matlab release 2020b (Version '9.9'). Why not using 10.0?

6 Comments

"Why not using 10.0?"
Because it is minor release 10 of version 9, and version 10 has not been released yet.
Because the version "number" does not represent a decimal fraction, just integers delimited by dots.
You might "feel" that it is lower, but for millions of programmers, testers, systems architects, etc. this style of version numbering feels normal and intuitive. Like anything, it is just a matter of getting used to it.
I do not understand why you think that a few minor bug fixes would consitute an increment in the major release version (which indicates major functional or codebase changes). Can you explain what Version 9 vs. Version10 means to you?
You could argue the Name=Value syntax constitutes a large enough change to warrant a main version increment.
It depends a bit whether you're looking at user-facing changes or internal changes. I mainly focussed on practical changes to daily users in my answer. I expect the real decision to increment the main version is based on the actual code structure, which may or may not be reflected in user-facing changes. HG2 is a prime example of a change that from a user perspective should have been a major version increment. I suspect there was enough of HG2 implemented in prior versions that the changes was more or less changing the default. But that is just conjecture based on thing I read on Yairs website quite a while ago, so I might be very wrong here.
Hi Rik,
Thank you for the answer. 9.01, 9.02 etc. could be an option too (99 smaller updates possible if using it numerically. I am just wondering how many users are aware of this version mistake if taking just str2double(Version). Your ifversion will work too of course, thank you.
"9.01, 9.02 etc. could be an option too "
Ugh, no. Then you just introduce another set of bugs due to beginners parsing those values as binary floating point and wondering why their code cannot find version X.01 (or why version X.YZ incorrectly compares as less than N, etc.) and then write to this forum complaining about the illogical decision to encode the version number in a way that cannot be represented exactly as a numeric value which they can use...
"I am just wondering how many users are aware of this version mistake if taking just str2double(Version)"
Do NOT do that! That approach is numerically unreliable (due to floating point rounding) and discards important data (X.2 is considered the same as X.20, whereas in fact they are totally different versions).
The mistake is doing str2double(ver('MATLAB').Version). You should not parse the version like that. You should either do something similar to what I showed in my answer, or use verLessThan.
help verLessThan
verLessThan Compare version of toolbox to specified version string. verLessThan(TOOLBOX_DIR, VERSION) returns true if the version of the toolbox specified by the string TOOLBOX_DIR is older than the version specified by the string VERSION, and false otherwise. VERSION must be a string in the form 'major[.minor[.revision]]', such as '7', '7.1', or '7.0.1'. If TOOLBOX_DIR cannot be found on MATLAB's search path, an error is generated. Examples: if verLessThan('images', '4.1') error('Image Processing Toolbox 4.1 or higher is required.'); end if verLessThan('matlab', '7.0.1') % Put code to run under MATLAB older than MATLAB 7.0.1 here else % Put code to run under MATLAB 7.0.1 and newer here end See also MATLABPATH, VER. Documentation for verLessThan doc verLessThan
Good to mention verLessThan! I forgot this function. This topic is answered now.

Sign in to comment.

 Accepted Answer

Versioning is a complex and hotly debated topic. Generally you want to increment the first number if you have a really big upgrade that introduces and/or breaks many functions.
In the past the first number has been incremented from 6 to 7 with the introduction of anonymous function (and an overhaul of the graphics and the JIT?). Version 8.0 (R2012b) introduced a completely new UI with a toolstrip. Interestingly the introduction of HG2 (a complete overhaul of how graphic objects behave) didn't merit an increment, but simply appeared in 8.4. If I recall correctly I have seen some suggestions that you could enable HG2 prior to that (for beta testing purposes), but I have never experimented with that.
The next increment came with R2016a, which introduced live scripts and the ability to pause an execution. It is not hard to see how those two changes would require many changes, ultimately leading to incrementing the main version number.
There is a big gap between R14 and R2012b. This has led to R2012a being version 7.14, so the issue you are pointing out has been bigger.
The main message is this: don't treat the version number as a decimal number. You need to think of it as major.minor.bugfix.build (I don't know if Mathworks is actually using this system; you could compare the version numbers between the release version and an updated version).
To answer the question in your title: apparently Mathworks didn't think the changes were so large that incrementing the main version number would be appropriate.
If you really want steadily increasing numbers you can either use something like my ifversion function (or verLessThan), or use code like this:
%only works for v7.2 and later
% R2020b is 20201 with this code
%10*str2double(regexprep(version,'.*R(\d\d\d\d)([ab]).*','${[$1 sprintf(''.%d'',double($2)-97)]}'))
[10,1]*(sscanf(regexp(version,'R\d{4}[ab]','match','once'),'R%d%c')-[0;97])
ans = 20210

2 Comments

str = version
str = '9.10.0.1613233 (R2021a)'
str = regexp(str,'R\d{4}[ab]','match','once')
str = 'R2021a'
num = [10,1]*(sscanf(str,'R%d%c')-[0;97])
num = 20210
That is much clearer than what I had, I'll edit my answer.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2021a

Asked:

on 8 Apr 2021

Edited:

Rik
on 9 Apr 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!