フィルターのクリア

Matrix Multiplication of different size

4 ビュー (過去 30 日間)
OriAlpha
OriAlpha 2018 年 12 月 18 日
編集済み: John D'Errico 2018 年 12 月 18 日
Hello,
i have 2 matrix of different size
how can i multiply
one is 2 * 2 and other is 103 * 1
so how can i do it
attached below both files
  3 件のコメント
OriAlpha
OriAlpha 2018 年 12 月 18 日
i am preforming the roatation of the points so i have to perform multiplication
John D'Errico
John D'Errico 2018 年 12 月 18 日
編集済み: John D'Errico 2018 年 12 月 18 日
But rotation of what points? I presume the 2x2 matrix is problably a rotation matrix from your statement. That is, it probably looks vaguely like this:
R = [cos(theta), -sin(theta) ; sin(theta), cos(theta)]
So applied to a pair of numbers [x;y] as a matrix multiply, it will rotate a point in the (x,y) plane. Thus we might have:
R = @(theta) [cosd(theta), -sind(theta) ; sind(theta), cosd(theta)];
R(45)*[1;0]
ans =
0.707106781186547
0.707106781186547
No problem. We mapped the point [1,0] into the new point [sqrt(2),sqrt(2)], as a 45 degree rotation. As such, this is a well defined operation.
However, you then apparently wish to apply that to a 103x1 vector. I'm sorry, but this part makes no sense in context of what you have stated as your goal.
Even if we decided that each consecutive pair of numbers is x(1), then y(1), x(2), y(2), etc., you have an odd number of elements in that vector. So rotation makes no sense in terms of what you have stated. You need to explain, CLEARLY, what rotation is to be performed, and what it means.

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

回答 (1 件)

madhan ravi
madhan ravi 2018 年 12 月 18 日
編集済み: madhan ravi 2018 年 12 月 18 日
load R.mat
load data.mat
data * (R(:)).' % matrix multiplication rules
%^---103 by 1 ^-------- 1 by 4
%The final matrix size after multiplication will be 103 by 4

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by