
2 Matrices and Arra ys
This matrix is almost the same as the one in the Dürer engraving and has
all the same “magic” properties; the only difference is that the two middle
columns are exchanged.
To make this
B into Dü rer’s A,swapthetwomiddlecolumns:
A = B(:,[1 3 2 4])
This says, for each of the rows of matrix B, reorder the elements in the order
1, 3, 2, 4. It produces
A=
163213
51011 8
96712
41514 1
WhywouldDürergotothetroubleofrearrangingthecolumnswhenhecould
have used MATLAB ordering? No doubt he wanted to include the date of the
engraving, 1514, at the bottom of his m agic square.
2-10
Comentários a estes Manuais