MATLAB BUILDER EX 1 Guía de usuario Pagina 139

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 164
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 138
Utility Library Classes
Field name only This format may be used only in the case of a
1-by-1 structure array and returns the named
field’s value. For example:
x("red") = 0.2
x("green") = 0.4
x("blue") = 0.6
In this example, the name of the Item
property was neglected. This is possible since
the
Item property is the default property
of the
MWStruct class. In this case the t wo
statements are equiv a lent:
x.Item("red") = 0.2
x("red") = 0.2
Single index and field name This format accesses array elements
through a single subscripting notation. A
single numeric index
n followed by the
field name returns the named field on
the
nth array element, navigating the
array linearly in column-major order.
Forexample,considera2-by-2arrayof
structures with fields
"red", "green",and
"blue" stored in a variable x.Thesetwo
statements are equiv a lent:
y = x(2, "red")
y = x(2, 1, "red")
C-19
Vista de pagina 138
1 2 ... 134 135 136 137 138 139 140 141 142 143 144 ... 163 164

Comentarios a estos manuales

Sin comentarios