Can the script detect the version of MATLAB on which the script run?

2 ビュー (過去 30 日間)
alpedhuez
alpedhuez 2020 年 12 月 13 日
コメント済み: Walter Roberson 2020 年 12 月 16 日
I write a script that depends on a new feature of R2020b. But other people may not have R2020b. Is it possible to write such as
if (the version is R2020b)
run hello_R2020b.m
else if
run hell_R2020a.m
end
?

採用された回答

Walter Roberson
Walter Roberson 2020 年 12 月 13 日
  5 件のコメント
alpedhuez
alpedhuez 2020 年 12 月 16 日
What is the data type of output?
Walter Roberson
Walter Roberson 2020 年 12 月 16 日
Character vector for ver().Version, logical for verlessthan

サインインしてコメントする。

その他の回答 (1 件)

John D'Errico
John D'Errico 2020 年 12 月 13 日
編集済み: John D'Errico 2020 年 12 月 13 日
WTP?
A = ver('matlab')
A =
struct with fields:
Name: 'MATLAB'
Version: '9.9'
Release: '(R2020b)'
Date: '29-Jul-2020'
Why you think you need to use run, I cannot imagine, but whatever floats your boat.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by