can we use numbers in variable names?

12 次查看(过去 30 天)
Hai,
Can we use numbers in variable names, while programming in matlab. For example, tetai2, 3abc, etc... Looking for your reply.
BSD

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-9-26
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by