Some MATLAB commands can be “applied to themselves”. A good example is
help help, which provides help on the
help function. For what other functions
fun fun a legal statement that produces something interesting? Here are some examples (by no means an exhaustive list).
char char demo demo diary diary doc doc diff diff double double edit edit error error iskeyword iskeyword length length magic magic max max size size sort sort spy spy unique unique upper upper warning warning which which
Can you see why these are legal and guess what the effect of these calls will be? Search for “command-function duality” in the MATLAB help for some clues.
Are there any legal triple invocations? Yes, for example
and and and char char char isa isa isa max max max
char can be iterated as many times as you like, but
isa can be iterated three times but not twice.
If you think of additional interesting examples, please add them to the comments below.