How to check MATLAB version and choose compatible functions?

160 ビュー (過去 30 日間)
Abdul Basith Ashraf
Abdul Basith Ashraf 2019 年 11 月 11 日
編集済み: Stefanie Schwarz 2023 年 9 月 14 日
sgtitle is available in MATLAB R2019b but not in R2018a
suptitle is available in MATLAB R2018a but not in R2019b.
If I'm distributing, how can I check the release to use the compatible function?

採用された回答

Sean de Wolski
Sean de Wolski 2019 年 11 月 11 日
編集済み: Stefanie Schwarz 2023 年 9 月 14 日

その他の回答 (2 件)

Oli Fairfax
Oli Fairfax 2021 年 8 月 23 日
You can also use the following to keep it on one line:
version('-release')
ans = '2021a'

Abdul Basith Ashraf
Abdul Basith Ashraf 2019 年 11 月 11 日
v= ver('MATLAB');
if v.Release=="(R2018a)"
%Code
elseif v.Release=="(R2019b)"
%Code
end

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by