How to check MATLAB version and choose compatible functions?

153 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Sean de Wolski
Sean de Wolski il 11 Nov 2019
Modificato: Stefanie Schwarz il 14 Set 2023

Più risposte (2)

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

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

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by