フィルターのクリア

rewrite A=[3*1] matrix to [3*3]*[3*1(var)]=A

1 回表示 (過去 30 日間)
shahin hashemi
shahin hashemi 2017 年 12 月 9 日
コメント済み: Star Strider 2017 年 12 月 9 日
dear all
i have 3*1 matrix like matrix E below
syms qd td ed q teta
E =[ ed*cos(q)*sin(teta) - cos(teta)*(qd*cos(q)*sin(teta) + td*cos(teta)*sin(q)) - td*sin(q)*sin(teta)^2 ; cos(teta)*(td*cos(teta)*sin(q) - qd*sin(q)*sin(teta)) + ed*sin(q)*sin(teta) + td*cos(q)*sin(teta)^2 ; ed*cos(teta) + cos(q)*sin(teta)*(qd*cos(q)*sin(teta) + td*cos(teta)*sin(q)) - sin(q)*sin(teta)*(td*cos(teta)*sin(q) - qd*sin(q)*sin(teta))]
that i want to rewrite it in [3*3]*[qd;td;ed]=[E] this form
is there any Command that can help me to calculate this [3*3] matrix by matlab
answer should be like this:
[ -cos(q)*cos(teta)*sin(teta), - cos(teta)^2*sin(q) - sin(q)*sin(teta)^2, cos(q)*sin(teta)]
[ -cos(teta)*sin(q)*sin(teta), sin(q)*cos(teta)^2 + cos(q)*sin(teta)^2, sin(q)*sin(teta)]
[ cos(q)^2*sin(teta)^2 + sin(q)^2*sin(teta)^2, cos(q)*cos(teta)*sin(q)*sin(teta) - cos(teta)*sin(q)^2*sin(teta), cos(teta)]
i really apreciated if you could help me

採用された回答

Star Strider
Star Strider 2017 年 12 月 9 日
Doing it by matrix division (the mldivide function) did not work because the rows are not consistent.
The only solution I can come up with is:
syms qd td ed q teta
E =[ ed*cos(q)*sin(teta) - cos(teta)*(qd*cos(q)*sin(teta) + td*cos(teta)*sin(q)) - td*sin(q)*sin(teta)^2 ; cos(teta)*(td*cos(teta)*sin(q) - qd*sin(q)*sin(teta)) + ed*sin(q)*sin(teta) + td*cos(q)*sin(teta)^2 ; ed*cos(teta) + cos(q)*sin(teta)*(qd*cos(q)*sin(teta) + td*cos(teta)*sin(q)) - sin(q)*sin(teta)*(td*cos(teta)*sin(q) - qd*sin(q)*sin(teta))];
v = [qd;td;ed];
for k1 = 1:size(E,1)
C{k1} = coeffs(E(k1), v);
end
Out = [C{1}; C{2}; C{3}]
The columns of ‘Out’ are with respect to the elements of ‘v’, in order. Change the order of ‘v’ to produce the result you want.
  2 件のコメント
shahin hashemi
shahin hashemi 2017 年 12 月 9 日
thanks alot with best wishes
Star Strider
Star Strider 2017 年 12 月 9 日
As always, my pleasure!
Best wishes to you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by