MATLAB POLYSPACE RELEASE NOTES Manuale Utente Pagina 150

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 240
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la 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
Vedere la pagina 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 239 240

Commenti su questo manuale

Nessun commento