can we use numbers in variable names?

18 visualizaciones (últimos 30 días)
bsd
bsd el 26 de Sept. de 2011
Hai,
Can we use numbers in variable names, while programming in matlab. For example, tetai2, 3abc, etc... Looking for your reply.
BSD

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 26 de Sept. de 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.

Más respuestas (0)

Categorías

Más información sobre Variables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by