matlabsub

Evaluate MATLAB® command given Microsoft® Excel® data and designate output location

Syntax

Worksheet:

matlabsub(command, edat, inputs)

command

MATLAB command to evaluate. Enter the MATLAB command in double quotation marks, as "command".

edat

Worksheet location where the function writes the returned date. "edat" (in quotation marks) directly specifies the location and it must be a cell address or a range name. edat (without quotation marks) is an indirect reference: the function evaluates the contents of edat to get the location. edat must be a worksheet cell address or range name.

inputs

Variable length input argument list passed to MATLAB command. This argument list can contain a range of worksheet cells that contain input data.

Description

Passes the specified command to the MATLAB workspace for evaluation, given the function input data. The function returns a single value or string depending upon the MATLAB output. This function is intended for use as an Excel® worksheet function.

To return an array of data to theMicrosoft® Excel Visual Basic® for Applications (VBA) workspace, see MLEvalString and MLGetVar.

Examples

Sum the data in worksheet cells B1 through B10, and then return the output to cell A1:

matlabsub("sum", "A1", B1:B10) 

See Also

matlabfcn

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS