populates the choices automatically (true or false). MATLAB takes the three values for
the 'Name2' argument from the JSON file.
Multiple Signatures
If a function has many syntaxes, it can be helpful for code suggestions to group syntaxes
as multiple function signatures (regardless of the implementation of the function). To
provide code suggestions and completions for multiple signatures, create multiple
function objects with the same property in the JSON file.
Consider the following function that follows different code paths depending on the class
of the second input. This function is presented as an example for code suggestions, and,
therefore, does not perform any computations or error checking.
function anotherFunc(arg1,arg2,arg3)
switch class(arg2)
case 'double'
% Follow code path 1
case {'char','string'}
% Follow code path 2
otherwise
error('Invalid syntax.')
end
end
From a code suggestions perspective, consider the function as having two function
signatures. The first signature accepts two required numeric values. The second
signature accepts a required numeric, followed by a character or string, and finally a
required numeric. To define multiple function signatures, define multiple function objects
in the JSON file with the same property (function name).
{
"_schemaVersion": "1.0.0",
30 Custom Help and Documentation