GETFULLMATRIX

Purpose:

Retrieves real or complex data from a command, Window or variable as two SafeArrays from DADiSP’s ActiveX Automation Server.

Syntax:

void GetFullMatrix(

[in] BSTR "name", [in] BSTR "workspace", [in, out] SAFEARRAY(double) *real, [in, out] SAFEARRAY(double) *imag)

"name"

-

A string, the name of the source Window or variable to retrieve.

"workspace"

-

A string, the name of the Workspace. Currently unused.

real

-

A SafeArray, the destination array for the real part.

imag

-

A SafeArray, the destination array for the imaginary part. Set to empty to ignore.

Returns:

Nothing.

Example:

Visual Basic Example:

 

Dim DADiSP as Object

Dim RealData(1, 3) as Double

Dim ImagData(1, 3) as Double

Dim ResultR as Double

Dim ResultI as Double

 

’’’ Create VB data arrays

For i = 0 To 1

    For j = 0 To 3 

        RealData(i, j) = (i + 1) * (j + 1) 

        ImagData(i, j) = 100 * RealData(i, j) 

    Next j 

Next i

 

’’’ Connect to DADiSP

Set DADiSP = CreateObject("dadisp.application")

 

’’’ put complex array to variable a

Call DADiSP.PutFullMatrix("a", "base", RealData, ImagData)

 

’’’ scale by 10

Call DADiSP.Execute("a *= 10;")

 

’’’ get result

Call DADiSP.GetFullMatrix("a", "base", RealData, ImagData)

 

’’’ show result

For i = 0 To 1

    For j = 0 To 3 

        ResultR = RealData(i, j) 

        ResultI = ImagData(i, j) 

    Next j 

Next i

 

 

Starts DADiSP as an ActiveX Automation server, and places a 2x4 complex array from Visual Basic into variable a. The variable is scaled by 10 and the scaled array is returned in the original VB arrays.

Remarks:

If the real SafeArray is empty, GetFullMatrix creates an array of the appropriate size. An empty array can be specified in Visual Basic with a declaration such as:

 

Dim MyArray() as Double

 

If the imaginary SafeArray is empty and the data is purely real, the imaginary part is not returned.

 

If the SafeArray has been allocated, the array is filled only up to the number of allocated rows and columns.

 

GetFullMatrix always returns the data in Cartesian (real / imaginary) form.

 

See GETCOMPLEXSERIES to specify Cartesian or Polar form.

 

GetFullMatrix explicitly retrieves the data as a SafeArray. See GETDATA to return a variant data type.

See Also:

CALCULATE

CASTVARIANTARRAY

EVALUATE

GETCHARARRAY

GETCOMPLEXDATA

GETCOMPLEXSERIES

GETSERIES

PUTCHARARRAY

PUTCOMPLEXDATA

PUTCOMPLEXSERIES

PUTDATA

PUTFULLMATRIX

PUTSERIES