Compatibility : get the Matlab minimum version required to run a program

조회 수: 12 (최근 30일)
Nicolas Douillet
Nicolas Douillet 2019년 11월 25일
편집: Rik 2019년 11월 25일
Hey,
Is there a way to automatically know which Matlab minimum version your .m program is compatible with ? Something like the ver command maybe ?
Thanks for help.
Nicolas

채택된 답변

Rik
Rik 2019년 11월 25일
편집: Rik 2019년 11월 25일
The only reliable way I have found is to actually test it. An alternative is to carefully read the documentation of every function you use to determine if you're using a syntax that was introduced later.
Edit: for a really high-level view of the changes from release to release, see this thread.
  댓글 수: 2
Nicolas Douillet
Nicolas Douillet 2019년 11월 25일
Yeah, looks reasonnable.
I run 2019b -the latest version-, so I would need to check all the previous ones I guess...
However, targeting the specific functions I use is quite a sure path, I agree.
The same for toolboxes, but in this case it is easier since I do not use -by far- all the toolboxes.
Thanks
Rik
Rik 2019년 11월 25일
I haven't used it myself, but toggleToolbox might be helpful in checking what works without which toolbox.
I wouldn't test it on all releases. It depends on how far back you want to go. Personally I try to make sure my code runs of version 6.5, which often requires a different implementation (and is overkill for just about any use case).
You can generally assume if something works on two releases it will work on the releases in between, but there are some caveats. I would suggest running the current release, an early HG2 release (2014b or later), and a late HG1 release (2014a or older). Add 2011a if you want to cover 99% of users. I couldn't get anything between v7 and 2011a to work on a 64 bit Windows 10 (and even 2011a requires RunAsDate to get the splash).
If you go extreme you can also check v6.5, which is hit or mis whether or not it will run on Windows 10. I would say it is more than reasonable to assume that if someone is running a version older than 6.5 they should be able to adapt the code themselves. Especially as ~ to suppress an unused output and @ to create an anonymous function will trigger syntax errors.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by