Documentation

GetFullMatrix

Matrix from Automation server workspace

Synopsis

IDL Method Signature

GetFullMatrix([in] BSTR varname, [in] BSTR workspace,
[in, out] SAFEARRAY(double) *pr, [in, out] SAFEARRAY(double) *pi)

MicrosoftVisual BasicClient

GetFullMatrix(varname As String, workspace As String,
[out] XReal As Double, [out] XImag As Double

MATLABClient

[xreal ximag] = GetFullMatrix(h,'varname','workspace',zreal,zimag)

Description

[xreal ximag] = GetFullMatrix(h,'varname','workspace',zreal,zimag)gets matrix stored in variablevarnamefrom the specifiedworkspaceof the server attached to handleh. The function returns the real part inxrealand the imaginary part inximag.The values forworkspacearebaseorglobal.

Thezrealandzimagarguments are matrices of the same size as the real and imaginary matrices (xrealandximag) returned from the server. Thezrealandzimagmatrices are commonly set to zero.

UseGetFullMatrixfor 2D matrices with values of typedoubleonly. UseGetVariableorGetWorkspaceDatafor other types. To use higher dimensional matrices, reshape the 2D matrix after receiving it from MATLAB®.

For VBScript clients, use theGetWorkspaceDataandPutWorkspaceDatafunctions to pass numeric data to and from the MATLAB workspace. These functions use thevariantdata type instead of thesafearraydata type used byGetFullMatrixandPutFullMatrix. VBScript does not supportsafearray.

Examples

This example uses a Visual Basic®.NET client to read data from a MATLAB Automation server:

  1. Create the Visual Basic application. To control flow between MATLAB and the application, use theMsgBoxcommand.

    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)")
  2. Open the MATLAB window and type:

    M(3,4)
  3. ClickOk.

  4. In the Visual Basic application:

    MatLab.GetFullMatrix("M", "base", XReal, XImag) i = 2 %0-based array j = 3 MsgBox("XReal(" & i + 1 & "," & j + 1 & ")" & _ " = " & XReal(i, j))
  5. To close and terminate MATLAB, clickOk.

Introduced before R2006a

Was this topic helpful?