Appendix A
A-16
PYTHON
8 MATLAB VIA ACTIVEX WRAPPER CLASS
A Python module has been included which declar
es the class
Matlab,
wrapping Matlab instantiation and execution.
You can test the Matlab connection by running the module as a Python
script.
8.1 CLASS MATLAB METHODS
GetSingleton(variablename, workspace = 'base')
Read a single value from a Matlab variable.
PutSingleton(variablename, value, workspace = 'base')
Write a single value to a Matlab variable.
GetMatrix(matrixname, columns = 1, rows = 1, workspace = 'base')
Get
a r
eal matrix.
The number of columns and rows of the matrix must be specified. Always
returns a matrix, even if it has one row. The value is a list of lists, with
each sub-list being one row.
GetMatrixOfSameSize(matrixname, dummy_matrix, workspace = 'base')
Returns
a real matrix, as
GetMatrix, but instead of specifying the
dimensions, pass a matrix with the expected dimensions. Its value will not
be changed.
Always r
eturns a matrix, even if it has one row.
PutMatrix(matrixname, real, workspace = 'base')
Put
a r
eal matrix. The value is a list of lists, with each sub-list being one
row.
GetComplexMatrix(matrixname, columns = 1, rows = 1, workspace =
'base')
Get both the real as the imaginary matrices. The number of columns and
rows of the matrices must be specified.
Comments to this Manuals