Solving Matrix Orthonormalization Problem with MATLAB

  • MATLAB
  • Thread starter morry
  • Start date
  • Tags
    Matlab
In summary, the conversation discusses using MATLAB to show that the columns of a 3x3 matrix are orthonormal. The participants suggest using the dot-operator to multiply the vectors element-by-element, and finding the scalar product of the vectors to prove orthogonality. They also mention using the command [V,D] = eig(A) to find the eigenvalues and eigenvectors of the matrix, which can be used to show that the vectors are linearly independent but not necessarily orthonormal. They also suggest using the commands quad and quadl to integrate area or distance from one point to another. The conversation ends with the participant successfully solving the problem and realizing their mistake.
  • #1
morry
136
0
Ok, this should be a simple problem, but its not working out for me.

I need to use MATLAB to show that the columns of a 3x3 matrix are orthonormal. I called each of the columns separate vectors, because I thought it would be easier. So now I have 3 3x1 vectors. I want to multiply them together to show they are orthogonal.
But MATLAB keeps returning an error. Saying that internal dimensions must match or something. Anyone know why this is happening?

Also, is there an easy way to show that the vectors are normal? I don't know of any commands to show this.

Thanks guys.
 
Physics news on Phys.org
  • #2
Matrix calculates everything with matrices. When you have 2 vectors with dimensions 1x4 (e.g. X and Y) and you want to multiply them, you cannot do X*Y since that would be multiplying a (1x4) with a (1x4) and that's impossible. You can use the dot-operator so that Matlab multiplies them element-by-element rather then seeing it as a matrix multiplication.

Instead of doing x*y, try x.*y
 
  • #3
To prove that the vectors are orthogonal, their scalar product must be zero. Calling your vectors [tex] V_1, V_2, V_3[/tex], you must find the products:
[tex]V_1 * V_2^'[/tex], [tex]V_2 * V_3^'[/tex] and [tex]V_3 * V_1^'[/tex].
 
  • #4
Talking about matlab, how do you intergrate area or distance from a point to another with a function?
 
  • #5
Werg22 said:
Talking about matlab, how do you intergrate area or distance from a point to another with a function?
If you mean the area below a function, you can use the functions:
quad Use adaptive Simpson quadrature
quadl Use adaptive Lobatto quadrature
 
  • #6
morry said:
Ok, this should be a simple problem, but its not working out for me.

I need to use MATLAB to show that the columns of a 3x3 matrix are orthonormal. I called each of the columns separate vectors, because I thought it would be easier. So now I have 3 3x1 vectors. I want to multiply them together to show they are orthogonal.
But MATLAB keeps returning an error. Saying that internal dimensions must match or something. Anyone know why this is happening?

Also, is there an easy way to show that the vectors are normal? I don't know of any commands to show this.

Thanks guys.

Think about this Morry, if you pre-multiple the matrix by it's transpose (M'*M), what does the occurance of zeros in the off diagonal positions tell you?
 
  • #7
uart said:
Think about this Morry, if you pre-multiple the matrix by it's transpose (M'*M), what does the occurance of zeros in the off diagonal positions tell you?

This would show that its orthog wouldn't it? I have to show that the vectors are orthonormal as well though.

Thanks a lot for your help guys. I knew there was a little trick I had to do. Cheers.
 
  • #8
In order for the vectors to form an orthonormal basis, they must be orthogonal and unit.
A unit vector has modulus 1.
|V| = V'*V
 
  • #9
Thanks SGT. Doing V'*V gives me 1s on the diagonal.

How would I actually go about orthog. diagonalising this matrix? If I was doing this by hand, I would just divide by its modulus, but I can't find the moduli of these vectors using matlab.

I have multiplied the 3x1 vectors to try and get them to equal 0, but they are not equalling 0.

Thanks guys.
 
  • #10
morry said:
Thanks SGT. Doing V'*V gives me 1s on the diagonal.

How would I actually go about orthog. diagonalising this matrix? If I was doing this by hand, I would just divide by its modulus, but I can't find the moduli of these vectors using matlab.

I have multiplied the 3x1 vectors to try and get them to equal 0, but they are not equalling 0.

Thanks guys.
If [tex]P[/tex] is an orthogonal matrix and [tex]B = P^{-1}AP = P'AP[/tex], then [tex]B[/tex] is said orthogonally similar to [tex]A[/tex].
If [tex]A[/tex] is real and symetric, it is orthogonally similar to a diagonal matrix whose diagonal elements are the eigenvalues of [tex]A[/tex].
In Matlab the command [tex][V,D] = eig(A)[/tex] returns two matrices. [tex]D[/tex] is a diagonal matrix containing the eigenvalues of [tex]A[/tex] and is orthogonally similar to [tex]A[/tex]. [tex]V[/tex] is a matrix containing in its columns the eigenvectors of [tex]A[/tex].
We have [tex]D = V^{-1}AV = V'AV[/tex]
 
  • #11
Thanks again SGT.

I am still unsure about how to show that my eigenvectors are orthonormal? I tried multiplying them like you mentioned, but they come out as numbers, not zero. Also, is there a command that finds the modulus of the vectors?
 
  • #12
The eigenvectors are not necessarilly orthonormal. All it is required is that they are linearly independent in order to form a basis.
To my knowledge there is no single command to calculate the modulus of a vector, but the command V´*V is so simple that I think any other command would be longer to type.
 
  • #13
v'v or vv' depending on if you used columns or vectors. or i believe there is a norm function. use the condition v'v or vv' < 1+e where e is a sufficiently small threshold

orthonormal system:
vi'vi < 1+e
abs(vi'vj)< 0+e
 
  • #14
Cheers everyone, I finally got the q out. I think I was being a bit of a dumbarse. :)
 

1. What is matrix orthonormalization?

Matrix orthonormalization is a process of transforming a matrix into an orthonormal matrix, where the columns are orthogonal to each other and have a length of 1. This is useful in various mathematical and statistical applications, such as solving systems of equations, data analysis, and signal processing.

2. Why is MATLAB commonly used for solving matrix orthonormalization problems?

MATLAB is a powerful software tool that is widely used in scientific and engineering fields. It has built-in functions and algorithms for performing matrix operations, making it efficient and convenient for solving matrix orthonormalization problems. MATLAB also has a user-friendly interface and provides visualization tools for easier data interpretation.

3. What is the process for solving matrix orthonormalization with MATLAB?

The process for solving matrix orthonormalization with MATLAB involves first loading the matrix data into the software, then using built-in functions such as "qr" or "orth" to perform the orthonormalization. The resulting orthonormal matrix can then be used for further analysis or calculations.

4. Can MATLAB handle large matrices for orthonormalization?

Yes, MATLAB has the capability to handle large matrices for orthonormalization. It uses efficient algorithms and can utilize multi-core processors for faster computations. However, the memory capacity of the computer may limit the size of the matrix that can be processed.

5. Are there any limitations to solving matrix orthonormalization with MATLAB?

One limitation of using MATLAB for solving matrix orthonormalization is that it may not be the most efficient tool for very large matrices. In such cases, specialized software or programming languages may be more suitable. Additionally, the accuracy of the orthonormalization results may be affected by the precision of the data input and the numerical methods used by MATLAB.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Linear and Abstract Algebra
Replies
14
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top