05242016 01:30 PM
b={4 9, 16 25, 36 49}; x={7 5, 16 9}; a=sqrt(b); * Assign square root of each element of B to corresponding element of A; y=inv(x); * Call INV function to compute inverse matrix of X and assign results to Y; r=rank(x);
I do not know how inv is calculated. I do not know how I can get the follow numbers. Can you explain the function of inv?Thanks. 0.529412  0.2941176 
0.9411765  0.411765

05242016 02:11 PM
Because the negative values are required so that X*inv(X) = I.
Since your example is a 2x2 matrix, there is even a formula for the inverse. for any numbers a,b,c, and d, define the matrix
A = {a b, c d};
Then
inv(A) = {d b, c a} / (adbc);
So you can see that if all the original elements are positive, then exactly two of the elements in the inverse must be negative.
05242016 01:37 PM
If Y is the inverse matrix of X, then Y*X = I, where I is the identity matrix that has 1s on the diagonal and 0s off the diagonal.
The inverse matrix is used to solve matrix equation. For example, if you are given a square nxn matrix A and and an nx1 vector w, then you might want to know if there is a vector v such that
A*v = w
Under certain conditions, the solution is the vector v = inv(A)*w.
05242016 01:56 PM
Thanks. I am not clear for some parts. Why I get negative numbers for inv?
05242016 02:11 PM
Because the negative values are required so that X*inv(X) = I.
Since your example is a 2x2 matrix, there is even a formula for the inverse. for any numbers a,b,c, and d, define the matrix
A = {a b, c d};
Then
inv(A) = {d b, c a} / (adbc);
So you can see that if all the original elements are positive, then exactly two of the elements in the inverse must be negative.