The following example sends the JMP variables x and y to MATLAB, executes the MATLAB statement z = x * y, and then gets the MATLAB variable z and returns it to JMP.

`MATLAB Init();`

x = [1 2 3];

y = [4 5 6];

MATLAB Execute( {x, y}, {z}, "z = x * y;" );

`Show( z );`

`// Get the MATLAB variable qbx and placed it into a JMP variable qbx.`

qbx = MATLAB Get( qbx );

`// Get the MATLAB variable df and placed it into a JMP data table referenced by df.`

df = MATLAB Get( df );

Table 2.1 shows what JMP data types can be exchanged with MATLAB using the MATLAB Get( ) function. Getting lists from MATLAB recursively examines each element of the list and sends each base MATLAB data type. Nested lists are supported.

Positional. The format the MATLAB graph display window contents are to be converted to. Valid formats are "png", "bmp", "jpeg", "jpg", "tiff", and "tif".

Echo(Boolean) Sends MATLAB source lines to the JMP log. This option is global. The default value is true.

`// Create a matrix, assign it to X, and send the matrix to MATLAB.`

X = [1 2 3];

ml = MATLAB Send( X );

`// Open a data table, assign a reference to it to dt, and send the data table along with its current row states to MATLAB.`

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

ml = MATLAB Send( dt, Row States( 1 ) );

Table 2.2 shows what JMP data types can be exchanged with MATLAB using the MATLAB Send( ) function. Sending lists to MATLAB recursively examines each element of the list and sends each base JMP data type. Nested lists are supported.

`MATLAB Init( );`

X = 1;

`MATLAB Send( X );`

S = "Report Title";

`MATLAB Send( S );`

M = [1 2 3, 4 5 6, 7 8 9];

MATLAB Send( M );

MATLAB Submit( "

`X`

`S`

`M`

`" );`

MATLAB Term( );

`MATLAB Init();`

mc = MATLAB Submit("/[

` x = rand(5);`

` fprintf('%f/n', x);`

` y = rand(5);`

` fprintf('%f/n', x);`

` z = plot(x, y);`

`]/" );`