MATLAB练习5

1. 创建一个5*5随机矩阵,并求逆。

>> A=rand(5)

 

A =

 

    0.7577    0.7060    0.8235    0.4387    0.4898

    0.7431    0.0318    0.6948    0.3816    0.4456

    0.3922    0.2769    0.3171    0.7655    0.6463

    0.6555    0.0462    0.9502    0.7952    0.7094

    0.1712    0.0971    0.0344    0.1869    0.7547

 

>> B=inv(A)

 

B =

 

   -0.4430    3.4997    1.3255   -2.6005   -0.4697

    1.4047   -1.1626    0.2422   -0.4475   -0.0119

    0.7210   -1.8189   -2.0635    2.4434    0.0765

   -0.6122   -0.1837    2.0165    0.0375   -1.2564

    0.0384   -0.5157   -0.7370    0.5267    1.7407

 

>>

 

2. 创建一个4*3随机矩阵,求逆。用到的函数与第一问相同,能否互换

>> a=rand(4,3)

 

你可能感兴趣的:(MATLAB练习5)