What is the correct name for the situation where a Matlab-script calls a function, but provides arguments without parentheses?
Example:
clear xx
Alternatively, I could use parentheses and transfer a string with the variable name:
clear('xx')
How can I distinguish between both alternatives when googling for a solution?
Bonus Question: How can I put the content of a variable into a call that is NOT using parentheses? Specifically, a build-script using mcc with a dynamic -o filename option; calling mcc with parentheses would also be acceptable, but I don't know how to google that, hence this question.
Thank you!
When you call a function without the brackets, it is called command syntax. Here are three links to relevant documentation:
Bonus answer
You cannot use a variable when using command syntax. From the docs:
So it would work like so:
When calling
mcc
as you suggest in the question, the tooltip shows you can in fact use function syntax, despite the documentation being entirely shown using command syntax.Notes
Using brackets is standard practise in MATLAB, since you also cannot get output values from a function when using command syntax.
Also from the 3rd docs link above, you can see a message discouraging the use of command syntax when using MATLAB.