User`s guide
A Producing a COM Object from MATLAB
A-10
MATLAB Compiler Output
The MATLAB Excel Builder generates a default Visual Basic function wrapper
for each class method with the following format:
Function foo(Optional X1 As Variant, _
Optional X2 As Variant, _
.
.
Optional varargin1 As Variant, _
Optional varargin2 As Variant, _
.
.
Optional vararginN As Variant) _
As Variant
Dim Y1, Y2, ..., varargout As Variant
Dim varargin As Variant
.
(other declarations)
.
.
(function body)
.
.
foo = Y1
.
.
(error handling code)
.
End Function
By default, the generated formula function contains an argument list with all
the inputs to the method call and a return value corresponding to the first
output parameter. The argument list includes each explicit input parameter. If
the optional
varargin parameter is present in the original MATLAB function,
additional arguments
varargin1, varargin2,...,vararginn are generated,
where
n is a number chosen by the builder. The number n is chosen so that the
total number of inputs is less than or equal to 32. This function generally
includes a declaration for each output parameter as type
Variant. If the
original MATLAB function contains a
varargin, a variable is declared of type