フィルターのクリア

Cross product in Matlab for 2*3 dim vectors

2 ビュー (過去 30 日間)
vigneshwaran Loganathan
vigneshwaran Loganathan 2018 年 7 月 13 日
Is it possible to cross 2*1 and 2*1 vectors in matlab I have a case,
A =
-20.5120
92.1404,
B =
3.5051
-3.9759
I have to cross(A,B), help me with your suggestions
  2 件のコメント
Rik
Rik 2018 年 7 月 13 日
In general you would extend the vectors with a zero to make them 3-element vectors. If this is valid in your case is something you'll have to figure out.
vigneshwaran Loganathan
vigneshwaran Loganathan 2018 年 7 月 13 日
I tried extending to a 3 element vector but it isn't the same what i expect, all the vector values are becoming zero

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

採用された回答

Diwakar
Diwakar 2018 年 7 月 13 日
編集済み: Diwakar 2018 年 7 月 13 日
As far as I understand your question you have two vectors with, x-component and y-component. Now, in order to use the in-build cross product function, the documentations mentions that you need to have a length of 3.
So if it doesn't affect you, then I too would suggest you to follow the same method that Rik has suggested to use the in-built function.
If not, you can try to generate your own code for the use case with the idea being, If A=[a1;a2]; B=[b1;b2]; then cross product will be C=(a1b2-a2b1); along the perpendicular to both the input vectors.
Hope this helps Cheers!
  1 件のコメント
vigneshwaran Loganathan
vigneshwaran Loganathan 2018 年 7 月 13 日
it helps indeed, thank you for the suggestion

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by