| MATLAB Function Reference | ![]() |
Test if string is a MATLAB keyword
Syntax
iskeyword 's'
iskeyword
R = iskeyword('s')
Description
iskeyword 's'
returns a 1 if string, s, is a keyword in the MATLAB language. Returns 0, otherwise.
iskeyword
returns a list of all MATLAB keywords.
R = iskeyword('s')
returns a 1 in R if string, s, is a MATLAB keyword.
Examples
To test if the word while is a MATLAB keyword
iskeyword 'while'
ans =
1
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
isvarname, is*
| isjava | ismember | ![]() |