Excel Link    
MLPutMatrix

Create or overwrite MATLAB matrix with data from Excel worksheet

Syntax

Worksheet:
MLPutMatrix(var_name, mdat)
Macro:
MLPutMatrix var_name, mdat
var_name
Name of MATLAB matrix to create or overwrite. "var_name" (in quotes) directly specifies the matrix name. var_name (without quotes) is an indirect reference: the function evaluates the contents of var_name to get the matrix name, and var_name must be a worksheet cell address or range name.
mdat
Location of data to copy into var_name. mdat (no quotes). Must be a worksheet cell address or range name.

Description

Creates or overwrites matrix var_name in MATLAB workspace with specified data in mdat. Creates var_name if it does not exist. If var_name already exists, this function replaces the contents with mdat. mdat must contain either numeric data or string data. Data types cannot be combined within the range specified in mdat. Empty mdat cells become MATLAB matrix elements containing zero if the data is numeric and empty strings if the data is a string.

Example

creates or overwrites matrix A in the MATLAB workspace with the data in the worksheet range A1:C3.

See Also

MLAppendMatrix, MLGetMatrix


  MLOpen MLPutVar