MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuel d'utilisateur Page 305

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 408
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 304
MATLAB ActiveX Automation Server Support
7-19
void PutFullMatrix(
[in] BSTR Name,
[in] BSTR Workspace,
[in] SAFEARRAY(double) pr,
[in] SAFEARRAY(double) pi);
Note The first statement above should be declared in the general
declarations section in order to keep the scope throughout the application.
This method puts a full, one- or two-dimensional real or imaginary
mxArray
into the named workspace. The real and (optional) imaginary parts are passed
in through separate arrays of doubles.
Name. Identifies the name of the mxArray to be placed.
Workspace. Identifies the workspace into which the mxArray should be placed.
Use the workspace name “base” to put the
mxArray into the default MATLAB
workspace. Use the workspace name “global” to put the
mxArray into the global
MATLAB workspace. The “caller” workspace does not have any context in the
API when used outside of MEX-files.
pr. Array of reals that contains the real values for the mxArray.
pi. Array of reals that contains the imaginary values for the mxArray. If the
mxArray that is being sent is not complex, an empty array must be passed for
this parameter. In Visual Basic, an empty array is declared as
Dim Mempty()
as Double
. A Visual Basic example of this method is
Dim MatLab As Object
Dim MReal(1, 3) As Double
Dim MImag() As Double
Dim i, j As Integer
For i = 0 To 1
For j = 0 To 3
MReal(i, j) = I * j;
Next j
Next I
rem We assume that the connection to MATLAB exists.
Call MatLab.PutFullMatrix("a", "base", MReal, MImag)
Vue de la page 304
1 2 ... 300 301 302 303 304 305 306 307 308 309 310 ... 407 408

Commentaires sur ces manuels

Pas de commentaire