Check code compatibility with older releases

조회 수: 49 (최근 30일)
William Thielicke
William Thielicke 2024년 2월 11일
댓글: William Thielicke 2024년 2월 11일
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!

채택된 답변

John D'Errico
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.

추가 답변 (1개)

Karl
Karl 2024년 2월 11일
편집: Karl 2024년 2월 11일
  댓글 수: 1
William Thielicke
William Thielicke 2024년 2월 11일
I tried this with R2019b. It doesn't detect another incompatibility:
Unrecognized property 'LabelAlpha' for class 'images.roi.Polyline'.
Error in PIVlab_GUI>extract_draw_extraction_coordinates_Callback (line 4460)
extract_poly.LabelAlpha = 0.5;
So it is actually completely useless.

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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by