MATLAB BUILDER EX 1 Uživatelská příručka Strana 168

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 182
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 167
D Utility Library
D-24
Property Real As Variant
Stores the real part of a complex array (read/write). The Real property is the
default property of the
MWComplex class. The value of this property can be any
type coercible to a
Variant, as well as object types, with the restriction that the
underlying array must resolve to a numeric matrix (no cell data allowed). Valid
Visual Basic numeric types for complex arrays include
Byte, Integer, Long,
Single, Double, Currency, and Variant/vbDecimal.
Property Imag As Variant
Stores the imaginary part of a complex array (read/write). The Imag property
is optional and can be
Empty for a pure real array. If the Imag property is
nonempty and the size and type of the underlying array do not match the size
and type of the
Real propertys array, an error results when the object is used
in a method call.
Example. The following Visual Basic code creates a complex array with the
following entries:
x = [ 1+i 1+2i
2+i 2+2i ]
Sub foo()
Dim x As MWComplex
Dim rval(1 To 2, 1 To 2) As Double
Dim ival(1 To 2, 1 To 2) As Double
On Error Goto Handle_Error
For I = 1 To 2
For J = 1 To 2
rval(I,J) = I
ival(I,J) = J
Next
Next
Set x = new MWComplex
x.Real = rval
x.Imag = ival
.
.
.
Exit Sub
Handle_Error:
Zobrazit stránku 167
1 2 ... 163 164 165 166 167 168 169 170 171 172 173 ... 181 182

Komentáře k této Příručce

Žádné komentáře