| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
[xreal ximag] = h.GetFullMatrix('varname', 'workspace',
zreal, zimag)
[xreal
ximag] = GetFullMatrix(h, 'varname', 'workspace',
zreal, zimag)
GetFullMatrix([in] BSTR varname, [in] BSTR workspace, [in, out] SAFEARRAY(double) *pr, [in, out] SAFEARRAY(double) *pi)
GetFullMatrix(varname As String, workspace As String, [out] XReal As Double, [out] XImag As Double
[xreal ximag] = h.GetFullMatrix('varname', 'workspace', zreal, zimag) gets matrix stored in variable varname from the specified workspace of the server attached to handle h. The function returns the real part in xreal and the imaginary part in ximag. The values for workspace are base or global.
[xreal ximag] = GetFullMatrix(h, 'varname', 'workspace', zreal, zimag) is an alternate syntax.
The zreal and zimag arguments are matrices of the same size as the real and imaginary matrices (xreal and ximag) returned from the server. The zreal and zimag matrices are commonly set to zero.
Use GetFullMatrix for values of type double only. Use GetVariable or GetWorkspaceData for other types.
For VBScript clients, use the GetWorkspaceData and PutWorkspaceData functions to pass numeric data to and from the MATLAB workspace. These functions use the variant data type instead of the safearray data type used by GetFullMatrix and PutFullMatrix. VBScript does not support safearray.
Use a MATLAB client to read data from a MATLAB Automation server:
%Create the MATLAB server
h = actxserver('matlab.application');
%Create variable M in the base workspace of the server
h.PutFullMatrix('M','base',rand(5),zeros(5));
MReal = h.GetFullMatrix('M','base',zeros(5),zeros(5))
Use a Visual Basic client to read data from a MATLAB Automation server:
Create the Visual Basic application. Use the MsgBox command to control flow between MATLAB and the application.
Dim MatLab As Object
Dim Result As String
Dim XReal(4, 4) As Double
Dim XImag(4, 4) As Double
Dim i, j As Integer
MatLab = CreateObject("matlab.application")
Result = MatLab.Execute("M = rand(5);")
MsgBox("In MATLAB, type" & vbCrLf _
& "M(3,4)")Open the MATLAB window and type:
M(3,4)
Click Ok.
At the MATLAB command line, type:
MatLab.GetFullMatrix("M", "base", XReal, XImag)
i = 2 %0-based array
j = 3
MsgBox("XReal(" & i + 1 & "," & j + 1 & ")" & _
" = " & XReal(i, j))Click Ok to close and terminate MATLAB.
Execute | GetVariable | GetWorkspaceData | PutFullMatrix
![]() | getframe | getinterpmethod | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |