Effacer les filtres
Effacer les filtres

can we use numbers in variable names?

12 vues (au cours des 30 derniers jours)
bsd
bsd le 26 Sep 2011
Hai,
Can we use numbers in variable names, while programming in matlab. For example, tetai2, 3abc, etc... Looking for your reply.
BSD

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 26 Sep 2011
Yes, as long as it doesn't start with a number. See doc genvarname for more details.
>> Var2=1;
2Var=3;
??? 2Var=3;
|
Error: Unexpected MATLAB expression.

Plus de réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT-Files 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