User`s guide

C Utility Library
Conversion Rules for Input Dates
Value Behavio r
mwDateFormatNumeric
Convert dates to numeric values as
indicated by the rule listed in CO M
VARIANT to MATLA B Conversion
Rules on page B-10.
mwDateFormatString
Convert input dates to strings.
Example. This example uses data conversion flags to reshape the output
from a method compiled from a MATLAB function that produces an output
vector of unknown length:
function p = myprimes(n)
if length(n)~=1, error('N must be a scalar'); end
if n < 2, p = zeros(1,0); return, end
p = 1:2:n;
q = length(p);
p(1) = 2;
for k = 3:2:sqrt(n)
if p((k+1)/2)
p(((k*k+1)/2):k:q) = 0;
end
end
p = (p(p>0));
This function produces a row vector of all the prime numbers from 0 to n.
Assume that this function is included in a class named
myclass that is
included in a component named
mycomponent with a version of 1.0. The
subroutine takes an Excel range and a
Double as inputs, and places the
generated prime numbers into the supplied range. The MATLAB function
produces a row vector, although you want the output in column format. It also
produces an unknown number of outputs, and you do not want to truncate
any output.
To handle these issues, set the
TransposeOutput flag and the
AutoResizeOutput flag to True. In previous examples, the Visual Basic
CreateObject function creates the necessary classes. This example uses an
C-14