matlab总结3--矩阵处理基础(新手必看)

mac2022-11-25  9

1.特殊矩阵的建立

    单位矩阵, 全一矩阵,零矩阵,  随机矩阵,魔方矩阵magic, 希尔伯特矩阵hilb

   Generate a 5-by-5 matrix of normally distributed random numbers.

r = randn(5)

  Generate a 5-by-5 matrix of uniformly distributed random numbers between 0 and 1.

r = rand(5)

2.矩阵和向量运算

det(A)行列式   inv(A)逆      A'转置

内积计算

a=[1, 2,4];

b=[2,5,8];

s=a*b';或者s=dot(a,b);

3.线性方程组求解

 

最新回复(0)