MATLAB POLYSPACE RELEASE NOTES Manual de usuario Pagina 150

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 240
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 149
4 Programming
This is because the first two cells are too large to print in this limited space,
but the third cell contains only a single number, 16!, so there is room to print it.
Here are two impo rtant points to remember. First, to retrieve the contents of
one of the cells, use subscripts in curly braces. For example,
C{1} retrieves
the magic square and
C{3} is 16!. Second, cell arrays contain copies of other
arrays, not pointers to thos e arrays. If you subsequently change
A, nothing
happens to
C.
You can use three-dimensional arrays to store a sequence of matrices o f the
same size. C ell arrays can be used to store a sequence of matrices of different
sizes. For example,
M = cell(8,1);
for n = 1:8
M{n} = magic(n);
end
M
produces a sequence of magic squares of different order:
M=
[1]
[ 2x2 double]
[ 3x3 double]
[ 4x4 double]
[ 5x5 double]
[ 6x6 double]
[ 7x7 double]
[ 8x8 double]
4-12
Vista de pagina 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 239 240

Comentarios a estos manuales

Sin comentarios