ExecuteMCode
 execute a list of MATLAB® code strings through the Maple-MATLAB® link

 Calling Sequence ExecuteMCode(codeStr, opts)

Parameters

 codeStr - string; a list of MATLAB® command strings to be executed opts - (optional) equation(s) of the form option = value; specify options for the ExecuteMCode command

Options

The opts arguments are optional arguments of the form option = value, where option is one of the names listed below. These arguments correspond to keyword parameters; the left side of an equation is the keyword, the right side is the value. Each keyword parameter has a default value that is assigned if the parameter is not passed.

The following paragraphs describe each of the keyword parameters. The first line of each paragraph specifies the format of the argument: the left side is the keyword and the right side specifies the type of the value. If the type is truefalse, then passing just the keyword is equivalent to passing keyword = $\mathrm{true}$.

 • path = string

Specifies the path of the MATLAB® working directory.  If this value is not specified, the path given by currentdir is used.

 • eol = string

Delimiter that separates the lines. If no value is specified, this option is set to the newline character ("\n") by default.

Description

 • The ExecuteMCode command sends MATLAB® command strings contained within input string codeStr to MATLAB® for execution one line at a time. Each line is separated by the string setting in the eol option.
 • This procedure requires the MATLAB® connection to be working and the MATLAB® mex compiler be set up. For more information, see MapleSimConnector[setup].
 • This command changes the working directory of MATLAB® to the location specified by the path option before executing the commands.
 • This command examines the input MATLAB® command strings to determine if the mex command is used. If it is, a test is performed to ensure mex has been set up properly in MATLAB®. If mex has not been set up, an error is raised. For instructions on how to set up the mex command, refer to the MATLAB® documentation.
 • This command also tests if Simulink® is installed and configured properly. An error is raised if Simulink® is not found. Instructions on how to install and set up Simulink®, refer to the Simulink® documentation.
 • After the checking process is complete, the MATLAB® command strings contained in CodeStr are sent to MATLAB® through the Matlab[evalM] command one line at a time for execution.

Examples

 > $\mathrm{with}\left(\mathrm{MapleSimConnector}\right):$
 > $\mathrm{ExecuteMCode}\left("simulink;"\right)$