ExecuteMatlabCommand

Sends the string command to Matlab and executes the command in Matlab.

Syntax

ExecuteMatlabCommand(command)

Parameters

Parameter

Type

Description

command

string

Matlab command to be run

Return

Returns a string with the result of the executed Matlab command.

Note

Any valid Matlab command that you can type at Matlab prompt can be used. For example, you can call a Matlab script or a function.

Examples

Python

import nex
nex.ExecuteMatlabCommand("x=randn(10,1);plot(x)")
varList = nex.ExecuteMatlabCommand("who")

NexScript

ExecuteMatlabCommand("x=randn(10,1);plot(x)")
varList = ExecuteMatlabCommand("who")