-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in arMyStr2Sym connected to MATLAB version #165
Comments
Similar problem in arCcode line 113. |
matver.Version 9.10 is converted to 9.1 in str2double. Replace by verLessThan command as suggested by laasfeld in issue #165
Thanks for pointing this out, should be fixed now! |
It seems this issue extends further than I originally thought. Multiple functions, including arCompileAll, arPlotMulti, arLink, arPlotX, arPlotY, arPlotV, arSym, arSubs, arSubsRepeated, arPlot2, arLoadData, arLoadModel, arReport, arMiniReport, check the Matlab version using ver('matlab') and convert to result to double. I implemented an ad hoc solution by replacing all occurrences of ver('matlab') with arVer, which has the same output as ver('matlab') but changing the Version field to 9.91 for 9.10. As this issue will persist for all future 9.x versions, it will become increasingly difficult to keep track of version specific behaviour. I propose to use verLessThan as suggested by @laasfeld instead, which is also the recommended way of implementing version specific behaviour by MathWorks. |
When calling arMyStr2Sym the function call fails. The problem seems to be on line 17
if(str2double(matver.Version) >= 9.4)
It branches into the else caluse and causes further problems with symbolic conversions for Matlab version 2021a as matver.Version value is '9.10' and str2double(matver.Version) equals 9.1, which of course is smaller than 9.4.
Possible solution is using verLessThan function (for example "if(~verLessThan('matlab', '9.4'))" ) or something similar.
verLessThan is added in R2007a so there should be sufficient backwards compatibility.
The text was updated successfully, but these errors were encountered: