How do I solve for H in matlab?

In summary, the conversation discusses the need for help implementing a piece of code into MATLAB. The code involves two matrices, Z and H, which are related by the equation Z = HTH. The goal is to solve for H in MATLAB, with the additional information that Z is made up of other known matrices and the code involves the use of A and n. The conversation also mentions that Z and A will always be positive, and that Z must be symmetric and positive definite. A possible solution is suggested using the MATLAB function "chol".
  • #1
Badger33
36
0
I need help implementing this bit of code into matlab. I have a known matrix lest call it Z. and I have another unknown matrix called H. The matrices are related by the following relationship.

Z = HTH

How do I solve for H in matlab? If it is relevant Z is a make up of other known matrices and that code in MATLAB is:

Z = A + 2*eye(n)

where A is the initial known matrix and n is just an integer.UPDATE: Yes A and Z will always be positive.
 
Last edited:
Physics news on Phys.org
  • #2
As an initial observation Z has to be symmetric and positive definite to do this, which puts restrictions on A. Assuming that this is true,

http://www.mathworks.com/help/matlab/ref/chol.html

is what you're looking for. This returns a matrix H that has the property you want and also is lower diagonal
 
  • #3
reply

see update
 

1. What is matrix math in Matlab?

Matrix math in Matlab refers to performing mathematical operations on matrices, which are rectangular arrays of numbers or symbols. Matlab is a programming language commonly used for scientific computing and has powerful tools for working with matrices.

2. How do I input a matrix in Matlab?

To input a matrix in Matlab, you can use the command "matrix = [row1; row2; ...; rowN]", where each row is separated by a semi-colon and the matrix is enclosed in square brackets. Alternatively, you can also use the "reshape" command to create a matrix from a vector of numbers.

3. What are some common matrix operations in Matlab?

Some common matrix operations in Matlab include addition, subtraction, multiplication, and division. Other useful operations include transposing a matrix, finding the inverse or determinant of a matrix, and solving systems of linear equations.

4. How do I solve a matrix equation in Matlab?

To solve a matrix equation in Matlab, you can use the "linsolve" function, which takes in the matrix of coefficients and the vector of constants as inputs. Alternatively, you can also use the backslash operator "\" to solve systems of linear equations.

5. Can Matlab handle large matrices?

Yes, Matlab can handle large matrices as it is designed for scientific computing and has efficient algorithms for working with large datasets. However, it is recommended to use sparse matrices or parallel computing techniques for very large matrices to optimize performance.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
815
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
829
  • Engineering and Comp Sci Homework Help
Replies
18
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
20
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Back
Top