Magic squares and linear algebra