MATLAB Function Reference | ![]() ![]() |
Determine if item is a MATLAB keyword
Syntax
Description
tf = iskeyword('str')
returns logical true (1
) if the string, str
, is a keyword in the MATLAB language and logical false (0
) otherwise.
iskeyword str
uses the MATLAB command format.
iskeyword
returns a list of all MATLAB keywords.
Examples
To test if the word while
is a MATLAB keyword
To obtain a list of all MATLAB keywords
iskeyword 'break' 'case' 'catch' 'continue' 'else' 'elseif' 'end' 'for' 'function' 'global' 'if' 'otherwise' 'persistent' 'return' 'switch' 'try' 'while'
See Also
![]() | isjava | isletter | ![]() |