MATLAB® displays optional arguments in a method signature
using the optional<T>
syntax, where T
is
the specific type. This feature is available in .NET Framework Version
4.0 and above.
To use a default method argument, pass an instance of System.Reflection.Missing.Value
.
If the method is not overloaded, you are not required to fill in all optional values at the end of a parameter list. For examples, see Skip Optional Arguments.
If a .NET class has overloaded methods with optional arguments, MATLAB picks the method matching the exact number of input arguments.
If the optional arguments of the methods are different by type, number, or dimension, MATLAB first compares the types of the mandatory arguments. If the types of the mandatory arguments are different, MATLAB chooses the first overloaded method defined in the class. If the types of the mandatory arguments are the same, specify enough optional arguments so that there is only one possible matching .NET method. Otherwise, MATLAB throws an error. For examples, see Call Overloaded Methods.
ByRef
Attribute in VB.NETThe rules for optional ByRef
arguments are
the same as for other method arguments, as described in VB.NET Method Access Modifiers. ByRef
arguments
on the RHS appear as optional and behave like any other optional argument.