필터 지우기
필터 지우기

Good morning please help me :( badly needed

조회 수: 1 (최근 30일)
Kevin Ryan Maravilla
Kevin Ryan Maravilla 2017년 12월 14일
편집: Walter Roberson 2017년 12월 14일
How can I equate two matrices element by element suppose the other matrix is a variable matrix?
Ex:
A= [ 1,2,3;2,5,6]
B= [ a+b,a^2+b,c+a;a^2,b,c]
Then the output should Evaluate the valuez of a,b and c
I am typing A=B but that doesnt work also if I type
Y=[A==B], the output will just become
"a+b ==1"
and so on
But does not solve the values what should I do.
Thank you

답변 (2개)

Torsten
Torsten 2017년 12월 14일
Symbolically, this is not possible since you have 6 equations in 3 unknowns.
Try the numeric way to get the least-squares solution for overdetermined problems:
x0=[1 2 3];
fun=@(x)[x(1)+x(2)-1,x(1)^2+x(2)-2,x(3)+x(1)-3,x(1)^2-2,x(2)-5,x(3)-6];
xsol=lsqnonlin(fun,x0)
Best wishes
Torsten.

Kevin Ryan Maravilla
Kevin Ryan Maravilla 2017년 12월 14일
Thank you very much.i'm sorry i asked incompletely, But i am referring to the cholesky method in which Symmetric Matrix will be multiplied to the product of a (lower triangular matrix and its transpose, in which a ,b,c,d,e,f are the variables)
Let A be the input symmetric matrix Let X be the product of lower triangular matrix and its . transpose
Suppose A is a 3x3 symmetric matrix : [1,2,3;2,5,6;3,6,1]
Then X is [a^2 ,ab,ac ; ab,b^2 + d^2,bc+de ;ac, bc+de ,c^2 +e^2 +f^2]
How can I compare A and X, element by element so that i will find the values of a,b,c,d,e,f I just cant type A=X it says error and it doesnt compute the values, i need to find the values of the said variables so that the output will show two matrices one is the lower triangular matrix with the values of a,b,c,d,e,f and the other one is its transpose
*we are not allowed to use chol function / built in functions
Thank you very much for your answer..

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by