1、Variable Names
(1)一个有效的变量名字是以字母开头,后面接上字母、数字或者下划线。在MATLAB中是区分大小写的,所以A和a是不同的变量。变量名字的最大长度是命令:namelengthmax所返回的值,其返回值为63。所定义的变量不能和MATLAB中的关键字相同,例如if和else。可以使用iskeyword得到一份完整的关键字列表:
>> iskeyword
ans =
'break'
'case'
'catch'
'classdef'
'continue'
'else'
'elseif'
'end'
'for'
'function'
'global'
'if'
'otherwise'
'parfor'
'persistent'
'return'
'spmd'
'switch'
'try'
'while'
Examples of valid names: | Invalid names: |