yalmip / YALMIP

MATLAB toolbox for optimization modeling
https://yalmip.github.io/
Other
464 stars 134 forks source link

Bug in function isVersionRecent #1241

Closed htadashi closed 1 year ago

htadashi commented 1 year ago

The function isVersionRecent compares version numbers with different lengths and returns true if the version numbers are equal. But it breaks if the lenghts are equal and less than 3.

Example:

>> isVersionRecent("2.0", "2.0")

returns the following error

Index exceeds the number of array elements. Index must not exceed 2.

Error in [isVersionRecent](matlab:matlab.internal.language.introspective.errorDocCallback('isVersionRecent', '/MATLAB Drive/isVersionRecent.m', 24)) ([line 24](matlab: opentoline('/MATLAB Drive/isVersionRecent.m',24,0)))
elseif version1Arr(3) >= version2Arr(3)