MATLAB POLYSPACE RELEASE NOTES Manuel d'utilisateur Page 150

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 240
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 239 240

Commentaires sur ces manuels

Pas de commentaire