can we use numbers in variable names?

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일

0 개 추천

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개)

카테고리

질문:

bsd
2011년 9월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by