Create or append MATLAB matrix with data from Microsoft Excel worksheet
= MLAppendMatrix(var_name,mdat)
MLAppendMatrix var_name,mdat
out = MLAppendMatrix(var_name,mdat)
= MLAppendMatrix(
appends
data in var_name
,mdat
)mdat
to MATLAB® matrix var_name
or
creates var_name
if it does not exist. Use
this syntax when working directly in a worksheet.
MLAppendMatrix
appends
data in var_name
,mdat
mdat
to MATLAB matrix var_name
or
creates var_name
if it does not exist. Use
this syntax in a VBA macro.
lets
you catch errors when executing out
= MLAppendMatrix(var_name
,mdat
)MLAppendMatrix
in
a VBA macro. If MLAppendMatrix
fails, then out
is
a string containing error code. Otherwise, out
is 0
.
|
Name of MATLAB matrix to which to append data.
|
|
Location of data to append to
|
|
|
MLAppendMatrix
checks the dimensions
of var_name
and mdat
to
determine how to append mdat
to var_name
.
If the dimensions allow appending mdat
as either
new rows or new columns, it appends mdat
to var_name
as
new rows. If the dimensions do not match, the function returns an
error.
If mdat
is not initially an Excel® Range
data
type and you call the function from a worksheet, MLAppendMatrix
performs
the necessary type coercion.
If mdat
is not an Excel Range
data
type and you call the function from within a Microsoft® Visual Basic® macro,
the call fails. The error message ByRef Argument Type Mismatch
appears.
To work with VBA code in Excel with Spreadsheet Link™, you must enable Spreadsheet Link as a reference in the Microsoft Visual Basic Editor. For details, see Installation.