MATLAB BUILDER EX 1 Guida Utente Pagina 49

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
Vedere la pagina 48
Modifying Flags
3-15
x(1,2) = 12
x(2,1) = 21
x(2,2) = 22
var2 = x
Set aClass = New mycomponent.myclass
Call aClass.foo(1,y1,var1)
Call aClass.foo(1,y2,var2)
Exit Sub
Handle_Error:
MsgBox(Err.Description)
End Sub
Here, two Variant variables, var1 and var2 are constructed with the same
numerical data, but internally they are structured differently.
var1 is a 2-by-2
array of
Variants with each element containing a 1-by-1 Double, while var2 is
a 1-by-1
Variant containing a 2-by-2 array of Doubles. According to the default
data conversion rules listed in Table B-3, COM VARIANT to MATLAB
Conversion Rules, on page B-10,
var1 converts to a 2-by-2 cell array with each
cell occupied by a 1-by-1
double, and var2 converts directly to a 2-by-2 double
matrix. The
InputArrayFormat flag controls how arrays of these two types are
handled. As it turns out, the two arrays in the previous example both convert
to double matrices because the default value for the
InputArrayFormat flag is
mwArrayFormatMatrix. This default is used because, as it turns out, array data
originating from Excel ranges is always in the form of an array of
Variants
(like
var1 of the previous example), and MATLAB functions most often deal
with matrix arguments. But what if you really want a cell array? In this case,
you set the
InputArrayFormat flag to mwArrayFormatCell. Do this by adding
the following line after creating the class and before the method call.
aClass .MWFlags.ArrayFormatFlags.InputArrayFormat =
mwArrayFormatCell
Setting this flag presents all array input to the compiled MATLAB function as
cell arrays.
Similarly, you can manipulate the format of output arguments using the
OutputArrayFormat flag. You can also modify array output with the
AutoResizeOutput and TransposeOutput flags.
AutoResizeOutput is used for Excel Range objects passed directly as output
parameters. When this flag is set, the target range automatically resizes to fit
Vedere la pagina 48
1 2 ... 44 45 46 47 48 49 50 51 52 53 54 ... 181 182

Commenti su questo manuale

Nessun commento

Anthem A2 manuály

Uživatelské manuály a uživatelské příručky pro Přijímače a zesilovače Anthem A2.
Poskytujeme 1 manuály pdf Anthem A2 ke stažení zdarma podle typů dokumentů: Uživatelský manuál






Další produkty a příručky pro Přijímače a zesilovače Anthem

Modely Typ Dokumentu
P5 Uživatelský manuál   Anthem P5 User Manual, 10 stránky
PVA 8 Uživatelský manuál   Anthem PVA 8 User Manual, 12 stránky
MRX 710 Uživatelský manuál   Anthem MRX 710 User Manual, 60 stránky
MRX 710 Uživatelský manuál   Anthem MRX 710 Manuel d'utilisation, 60 stránky
BLX 200 Uživatelský manuál   Anthem BLX 200 User Manual, 46 stránky