Good morning please help me :( badly needed
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (2 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!