Check code compatibility with older releases
조회 수: 49 (최근 30일)
이전 댓글 표시
Hi, I am wondering if there is a more or less efficient way to check backwards compatibility. Here is an example: I am using this code in R2023a:
roi = images.roi.Rectangle;
roi.EdgeAlpha=0.75;
roi.FaceAlpha=0.05;
roi.LabelVisible = 'on';
roi.Tag = 'RegionOfInterest';
But a user reports problems with R2019b, ROI.EdgeAlpha doesn't exist yet in this release. I searched MATLAB help to find any info in which release this property was added, but I can't find any information. This has happened relatively often, and I wonder what I am doing wrong. How can I find information about properties that are missing in older releases? Thanks!
댓글 수: 0
채택된 답변
John D'Errico
2024년 2월 11일
편집: John D'Errico
2024년 2월 11일
A way to automatically check code compatibility with older releases, and see at what point a feature that you use makes your code not backwards compatible? No. Sorry.
You would need to have those older releases installed on your computer. That is possible to some extent, as long as they themselves will launch on your computer.
Even then, you would need to have test suites for your code that will test all possible paths through your code, to insure that every possible feature in your code is fully verified. Few authors do that as it is anyway. I often try, but I'll admit that my own set of tests surely miss some things. True perfection is difficult to achieve.
Even that fails however. For example, older releases of MATLAB will not run at all on newer computers. This is due to many things, generally not anything under the control of The MathWorks. So you might have some feature in your code that is viable in an older release, but you will not be able to test that older release, because something else prohibits your computer from running that release at all. And that would force you to maintain multiple older computers at your site, just to test code compatibility. And then you need to deal with issues of different manufacturers, completely different operating systems. Mac versus Windows, etc.
Sorry. If you want to know if something will fail, you will need to read the release notes diligently. Simpler yet, just wait for reports to filter in, that something failed. But there is no direct, magical, automatic way to do what you wish to see.
댓글 수: 0
추가 답변 (1개)
Karl
2024년 2월 11일
편집: Karl
2024년 2월 11일
Mathworks Support Team has suggested codeCompatibilityReport to check compatibility with MATLAB R2017b and newer:
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!