MATLAB BUILDER EX 1 Guía de usuario Pagina 163

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 182
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 162
Utility Library Classes
D-19
All indices and field name.
This format accesses an array element of an multidimensional array by
specifying
n indices. These statements access all four of the elements of the
array in the previous example:
For I From 1 To 2
For J From 1 To 2
r(I, J) = x(I, J, "red")
g(I, J) = x(I, J, "green")
b(I, J) = x(I, J, "blue")
Next
Next
Array of indices and field name.
This format accesses an array element by passing an array of indices and a
field name. The next example rewrites the previous example using an index
array:
Dim Index(1 To 2) As Integer
For I From 1 To 2
Index(1) = I
For J From 1 To 2
Index(2) = J
r(I, J) = x(Index, "red")
g(I, J) = x(Index, "green")
b(I, J) = x(Index, "blue")
Next
Next
With these four formats, the Item property provides a very flexible indexing
mechanism for structure arrays. Also note:
You can combine the last two indexing formats. Several index arguments
supplied in either scalar or array format are concatenated to form one index
set. The combining stops when the number of dimensions has been reached.
For example:
Dim Index1(1 To 2) As Integer
Dim Index2(1 To 2) As Integer
Vista de pagina 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 181 182

Comentarios a estos manuales

Sin comentarios