How to check MATLAB version and choose compatible functions?

173 vues (au cours des 30 derniers jours)
Abdul Basith Ashraf
Abdul Basith Ashraf le 11 Nov 2019
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?

Réponse acceptée

Sean de Wolski
Sean de Wolski le 11 Nov 2019
Modifié(e) : Stefanie Schwarz le 14 Sep 2023

Plus de réponses (2)

Oli Fairfax
Oli Fairfax le 23 Août 2021
You can also use the following to keep it on one line:
version('-release')
ans = '2021a'

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

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by