MLPutMatrix
Create or overwrite MATLAB matrix with data from Microsoft Excel worksheet
Description
Examples
Input Arguments
Tips
If
var_name
exists, theMLPutMatrix
function replaces its contents with the contents ofmdat
.Empty numeric data cells in
mdat
become numeric zeros in the MATLAB matrix identified byvar_name
.If any element of
mdat
contains string data,mdat
becomes a MATLAB cell array. Empty string elements inmdat
becomeNaN
s in the MATLAB cell array.When using
MLPutMatrix
in a subroutine, indicate the source of the worksheet data using the Microsoft® Excel macroRange
. For example:Sub test() MLPutMatrix "a", Range("A1:A3") End Sub
If you have a named range in your worksheet, you can specify the name instead of the range. For example:
Sub test() MLPutMatrix "a", Range("temp") End Sub
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.
Version History
Introduced before R2006a