Check code compatibility with older releases

18 ビュー (過去 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 Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by