can we use numbers in variable names?

14 visualizzazioni (ultimi 30 giorni)
bsd
bsd il 26 Set 2011
Hai,
Can we use numbers in variable names, while programming in matlab. For example, tetai2, 3abc, etc... Looking for your reply.
BSD

Risposta accettata

Fangjun Jiang
Fangjun Jiang il 26 Set 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.

Più risposte (0)

Categorie

Scopri di più su Variables 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