方阵的行列式

image.png

  1. >> format rat
  2. >> A = [1,3,2; -3,2,1; 4,1,2]
  3. A =
  4. 1 3 2
  5. -3 2 1
  6. 4 1 2
  7. >> det(inv(A))
  8. ans =
  9. 1/11
  10. >> 1 / det(A)
  11. ans =
  12. 1/11

矩阵的秩

image.png
求3~20阶魔方阵的秩

  1. >> for n = 3:20
  2. r(n) = rank(magic(n));
  3. end
  4. >> bar(r)

image.png
image.png

矩阵的迹

image.png

向量和矩阵的范数

  1. 向量的三种常用范数

image.png
image.png

  1. 矩阵的范数

image.png
image.png

  1. >> x = [2 0 1; -1 1 0; -3 3 0]
  2. x =
  3. 2 0 1
  4. -1 1 0
  5. -3 3 0
  6. >> n = norm(x)
  7. n =
  8. 4.7234
  9. >> n = norm(x, 1)
  10. n =
  11. 6

矩阵的条件数

image.png
image.png
求2~10阶希尔伯特矩阵的条件数

  1. >> for n = 2:10
  2. c(n) = cond(hilb(n));
  3. end
  4. >> format long
  5. >> c'
  6. ans =
  7. 1.0e+13 *
  8. 0
  9. 0.000000000001928
  10. 0.000000000052406
  11. 0.000000001551374
  12. 0.000000047660725
  13. 0.000001495105864
  14. 0.000047536735691
  15. 0.001525757556663
  16. 0.049315340455101
  17. 1.602502816811318