PUTFULLMATRIX

Purpose:

Stores real or complex data in Cartesian form to a Window or variable as two SafeArrays to DADiSP’s ActiveX Automation Server.

Syntax:

void PutFullMatrix(

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

"name"

-

A string, the name of the Window or variable to store.

"workspace"

-

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

real

-

A SafeArray, the source array for the real part.

imag

-

A SafeArray, the source 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 array

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 imaginary SafeArray is empty, PutFullMatrix ignores the imaginary part. An empty array can be specified in Visual Basic with a declaration such as:

 

 Dim MyArray() as Double

 

PutFullMatrix always stores complex data in Cartesian (real / imaginary) form. See PUTCOMPLEXSERIES to explicitly specify Cartesian or Polar form.

 

PutFullMatrix explicitly stores the data as a SafeArray. See PUTDATA to store variant data types.

See Also:

CALCULATE

EVALUATE

EXECUTE

GETCOMPLEXDATA

GETCOMPLEXSERIES

GETFULLMATRIX

GETDATA

GETSERIES

PUTCOMPLEXDATA

PUTDATA

PUTSERIES