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

2 vues (au cours des 30 derniers jours)
alpedhuez
alpedhuez le 13 Déc 2020
Commenté : Walter Roberson le 16 Déc 2020
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
?

Réponse acceptée

Walter Roberson
Walter Roberson le 13 Déc 2020
  5 commentaires
alpedhuez
alpedhuez le 16 Déc 2020
What is the data type of output?
Walter Roberson
Walter Roberson le 16 Déc 2020
Character vector for ver().Version, logical for verlessthan

Connectez-vous pour commenter.

Plus de réponses (1)

John D'Errico
John D'Errico le 13 Déc 2020
Modifié(e) : John D'Errico le 13 Déc 2020
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.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by