User`s guide

Utility Library Classes
D-9
method performs this transformation and additionally converts dates in string
form to COM date types.
Example. This example uses MWDate2VariantDate to process numeric dates
returned from a method compiled from the following MATLAB function.
function x = getdates(n, inc)
y = now;
for i=1:n
x(i,1) = y + (i-1)*inc;
end
This function produces an n-length column vector of numeric values
representing dates starting from the current date and time with each element
incremented by
inc days. 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 dates into the supplied range. If an error occurs, a
message box displays the error text. This function assumes that
MWInitApplication has been previously called.
Sub GenDates(R As Range, inc As Double)
Dim aClass As Object
Dim aUtil As Object
On Error GoTo Handle_Error
Set aClass = CreateObject("mycomponent.myclass.1_0")
Set aUtil = CreateObject("MWComUtil.MWUtil")
Call aClass.getdates(1, R, R.Rows.Count, inc)
Call aUtil.MWDate2VariantDate(R)
Exit Sub
Handle_Error:
MsgBox (Err.Description)
End Sub
Class MWFlags
The MWFlags class contains a set of array formatting and data conversion flags
(See Data Conversion Rules on page B-2 for more information on conversion
between MATLAB and COM Automation types). All MATLAB Excel Builder