Matlab
setvar
set a numerical array or matrix in an open MATLAB(R) session
Calling Sequence
Parameters
Description
Examples
setvar(X, Y, 'globalvar')
X
-
string naming the MATLAB® variable
Y
MapleMatrix or MatlabMatrix
'globalvar'
optional parameter asserting that X is global
The setvar command sets the MATLAB® variable X to the value of the matrix Y.
The variable Y can be a MapleMatrix or a MatlabMatrix. The effect of Matlab[setvar] is to assign X=Y in the MATLAB® memory space.
If you specify the 'globalvar' option, then the variable X in the MATLAB® session is flagged as a global variable. Use this option for running MATLAB® functions that use global variables.
Executing the setvar command returns a null.
Initialize a matrix in Maple and copy it to the MATLAB® environment.
with⁡Matlab:
maple_matrix_a≔35,623,22,115
setvar⁡matlab_matrix_a,maple_matrix_a
Assert that the matrix should be set as a global variable in the MATLAB® environment.
maple_matrix_b≔LinearAlgebraRandomMatrix⁡16
setvar⁡matlab_matrix_b,maple_matrix_b,globalvar
The setvar command can also be used to assign another name to an existing matrix in the MATLAB® environment. Notice that the second parameter is a string.
setvar⁡matlab_matrix_c,matlab_matrix_b
See Also
Matlab[defined]
Matlab[dimensions]
Matlab[getvar]
Matlab[size]
Matlab[square]
MatlabMatrix
Download Help Document