Skip to Main Content Skip to Search
Product Documentation

matlabsub - Evaluate MATLAB command given Microsoft Excel data and designate output location

Syntax

matlabsub(command,edat,inputs)

Description

matlabsub(command,edat,inputs) 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.

Tips

Input Arguments

command

MATLAB command to evaluate.

Enter the MATLAB command in double quotes, for example, "command".

edat

Worksheet location where the function writes the returned data.

edat in quotes directly specifies the location.edat without quotes specifies a worksheet cell address (or range name) that contains a reference to the location. In both cases, edat must be a cell address or a range name.

Although you can specify a range of output cells, matlabsub does not support multiple outputs. Instead of returning multiple outputs, matlabsub returns the first output starting in the first cell from the specified range, and discards all other outputs.

inputs

Variable length input argument list passed to MATLAB command.

This argument list can contain a range of worksheet cells that contain input data.

Examples

Compute the Sum of Data and Return Result to the Specified Cell

Sum the data in worksheet cells B1 through B10 returning the output to cell A1:

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

See Also

matlabfcn | MLShowMatlabErrors

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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