Finding generalized inverse matrices of non-square matrix in MATLAB

Source: Internet
Author: User

If it is not a square matrix, there will be a generalized inverse matrix (pseudo inverse), which is implemented using pinv () in MATLAB.
The basic syntax is X = pinv (A), x = pinv (A, Tol), where ToL is an error, and pinv is the abbreviation of pseudo-inverse: max (SIZE ()) * norm (a) * EPS.The function returns a matrix X that is the same as the transpose matrix A' of.And satisfies the following requirements: Axa = A, xax = x. In this case, matrix X is called the pseudo-inverse of matrix A, also known as the generalized inverse matrix.

  1. > A = rand (2, 3)
  2. A =
  3. 0.9572 0.8003 0.4218
  4. 0.4854 0.1419 0.9157
  5. > B = pinv ()
  6. B =
  7. 0.5985-0.0838
  8. 0.7633-0.5430
  9. -0.4355 1.2206
  10. > A * B *
  11. Ans =
  12. 0.9572 0.8003 0.4218
  13. 0.4854 0.1419 0.9157

CopyCode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.