the arguments block can be used to validate input arguments. Great! Except that it doesn't seem to work as advertised.
According to the documentation (doc arguments)
"The value assigned to the argument in the function call must be compatible with the specified size, or MATLAB throws an error."
However, when calling this function
function a=f(a)
arguments
a (1,3) double
end
end
with a scalar
The function expands the erroneous scalar argument to a 3-element vector instead of casting the error that was promised!
Why would this be? Am I reading it wrong?