inv的用法

2020-12-17  本文已影响0人  朱华宝塔

/和\可以用来求逆,A/B相当于A*inv(B),A\B相当于inv(A)*B。

inv([1 2;3 4])矩阵求逆,只能对方阵操作。

Y = inv(X) returns theinverse of the square matrix X. A warning messageis printed if X is badly scaled or nearly singular.

In practice, it is seldom necessary to form the explicit inverseof a matrix. A frequent misuse of inv arises whensolving the system of linear equations Ax = b.One way to solve this is with x = inv(A)*b.A better way, from both an execution time and numerical accuracy standpoint,is to use the matrix division operator x = A\b.This produces the solution using Gaussian elimination, without formingthe inverse. See mldivide (\)for further information.

inv是矩阵求逆的意思。具体用法A=inv(B),其中B是输入的可逆矩阵,输出A就是B的逆矩阵,逆矩阵满足性质 AB=BA=E (E是单位阵)。如果输入的是不可逆矩阵会弹出警告,并返回inf。

上一篇下一篇

猜你喜欢

热点阅读