Division of Matrices in MatLab: Explained

  • Context: MATLAB 
  • Thread starter Thread starter magda3227
  • Start date Start date
  • Tags Tags
    Division Matrix
Click For Summary

Discussion Overview

The discussion centers around the division of matrices in MATLAB, specifically addressing how MATLAB handles matrix division when one of the matrices is non-square. Participants explore the underlying mechanics of this operation and seek clarification on the results produced by MATLAB.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant notes that matrices cannot be divided and suggests that multiplication by the inverse is necessary, raising a question about how MATLAB performs division.
  • Another participant provides a link to MATLAB's help file, which explains that A/B is equivalent to A multiplied by the inverse of B, but acknowledges the difficulty in calculating the inverse of a non-square matrix.
  • A participant expresses confusion over the MATLAB documentation, which states that A/B can also be represented as (B'\A')', and questions how this leads to the specific numerical result of 2.3846.
  • One participant introduces the concept of least squares solutions for under- or overdetermined systems, suggesting that the division operation may relate to solving such systems, though they express uncertainty about the details.
  • Links to the Moore-Penrose pseudoinverse are shared, indicating a potential avenue for understanding the division operation in MATLAB.
  • A later reply reflects on the Moore-Penrose pseudoinverse, indicating that the participant took time to understand the concept and found it helpful, though initially challenging.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the mechanics of matrix division in MATLAB, with multiple competing views and uncertainties remaining about how the operation is executed, particularly with non-square matrices.

Contextual Notes

There are limitations in understanding the implications of matrix dimensions and the specific conditions under which MATLAB performs matrix division. The discussion does not resolve the mathematical steps involved in the operation.

magda3227
Messages
19
Reaction score
0
As far as I know, matrices cannot be divided, you have to multiply one matrix by the inverse of the other...I believe.

However, I am converting MatLab code into ANSI C and MatLab apparently divides two matrices. An example is the following...

>>A=[1.5708 1.5708];
B=[0.4937 0.7652];
A/B

ans =

2.3846


I have no idea how MatLab generated this answer. I try to find the inverse of the second matrix, but since it is a non-square matrix, MatLab denies my request. Can anyone aid me in figuring out how such an answer was calculated? Thank you in advance.
 
Physics news on Phys.org
I looked through that as well, but it says that it is equal to A*inverse(B)...but like I said, I cannot calculate the inverse of B. MatLab itself won't do it for me if I write the command line, so I don't see how it completes the matrix division calculation without finding the inverse of B.

It also says that it is equivalent to A/B = (B'\A')'. But again, You have to divide two matrices, only here, it is the conjugate transposes of the two. So even if I find the conj. transposes of the two (which will basically move the rows into columns), I still cannot find out how they got 2.3846 as an answer.
 
Presumably you need to decipher:
If A is an m-by-n matrix with m ~= n and B is a column vector with m components, or a matrix with several such columns, then X = A\B is the solution in the least squares sense to the under- or overdetermined system of equations AX = B. The effective rank, k, of A is determined from the QR decomposition with pivoting (see Algorithm for details). A solution X is computed that has at most k nonzero components per column.

It's too late here for me to get my head around that, but someone else will probably come along who can.
 
maze said:

THANKS!

I had a look at this before, but I didn't really understand it, so I looked for simpler explanations. It took my stupid self about 30 minutes to fully comprehend what it was saying. I really had to read slowly. lol. It is very brief, but rightfully so. Not much more explaining needed once you get it. Thanks a bunch.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
11
Views
6K
  • · Replies 13 ·
Replies
13
Views
4K