MATLAB: How to define a function signature for use with the Spreadsheet Link EX Function Wizard

Spreadsheet Link

How can I define a function signature so that it is displayed in the MATLAB Function Wizard as shown here:
web([docroot '/toolbox/exlink/f2-2311.html#bq8li7e-1'])

Best Answer

The different function signatures are imported automatically from the comments of that function. Using VARARGIN or not is not relevant, only the data that is contained in the comments is relevant.
Here's an example:
function [varargout] = testfunc(varargin)
% TESTFUNC Function description goes here.
% A = testfunc(A, B) Test signature 1.
% Continued from first signature.
%



% A = testfunc(A, B, X, Y) Test signature 2.
%
% A = testfunc(A, B, X, Y, Z) Test signature 3.
%
% A = testfunc_TEST(A, B) This will be ignored because the function name does not match.
%