How can I find a matrix which is orthogonal to another matrix?

I have a matrix A, and want to find the matrix B which is orthogonal to A. How can I do it in Matlab?
e.g. A=[1,2;2,3;3,4]
Thank you in advance!

9 Comments

Define "orthogonal" for rectangular matrices.
Best wishes
Torsten.
Thank you! Yes, I mean orthogonal to a rectangular matrix. Is that what you mean?
In the above case you want to find a row vector v such that
v*[1;2;3] = v*[2;3;4] = 0
?
Is this correct ?
Best wishes
Torsten.
Actually I am not quite sure. I want to find a matrix/vector which is orthogonal to a matrix.
The only solution I can think of is null(A), the kernel of the matrix.
help null
Best wishes
Torsten.
I will have a look. Thank you very much Torsten!
@Yang Yue: You have repeated some times now, that you want a matrix "orthogonal to a rectangular matrix", but you did not define this expression. Orthogonality of matrices is known for square matrices. So please explain mathematically the wanted properties of the matrix.
Thank you. I read in a paper that matrix B "is the orthogonal matrice to A". I may misunderstood the meaning...

Sign in to comment.

 Accepted Answer

Dear all,
I found the solution. It's called "orthogonal complement". The code here should be
null(alpha','r')
Thank all of your contributions!
Best wishes,
Yang

More Answers (2)

Maybe you mean the QR decomposition:
A = [1,2; 2,3; 3,4]
[Q, R] = qr(A)
Now Q is an orthogonal matrix, or in other words: Q*Q' == eye(3) . But it is not "orthogonal to A". But please explain, what this exactly means. Perhaps:
A * B == eye(3)
or
B * A == eye(2)
?

8 Comments

Thanks for the answer! I mean is there a matrix B, B*A=0?
Now I am thinking I mean B*A==eye(2)...
"I mean is there a matrix B, B*A=0?"
Orthogonal matrices (which are square) are defined by the property Q*Q'=I and Q'*Q=I, so how is zero relevant to the question?
So I think I was wrong... How can I get the matrix B which "is the orthogonal matrice to A"?
Z = null(A)
gives you the matrix orthogonal to A.
https://de.mathworks.com/help/matlab/ref/null.html
Best wishes
Torsten.
I've tried, but it returns to an empty matrix. I think I need to read more things about "orthogonal".
For your matrix, only x=[0; 0] satisfies A*x=0.
Check the result with A = [1 2 3; 2 3 4].
Best wishes
Torsten.
Oh I see. Thank you again!
Best wishes, Yang

Sign in to comment.

The concept of orthogonality for a matrix is defined for just one matrix: A matrix is orthogonal if each of its column vectors is orthogonal to all other column vectors and has norm 1. The concept of two matrices being orthogonal is not defined.
Here's a similar question on math.stackexchange, perhaps one of the answers there would be helpful?

1 Comment

Thank you for the answer. I think I found something. What I want to find is called "orthogonal complement of a subset".

Sign in to comment.

Categories

Asked:

on 9 Feb 2018

Answered:

on 11 Feb 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!