フィルターのクリア

Projection matrix equation equivalent?

3 ビュー (過去 30 日間)
tree317
tree317 2017 年 10 月 21 日
コメント済み: tree317 2017 年 10 月 21 日
Hello,
I am relative new to matlab and would sincerely appreciate some help in understanding the logic of calculations that use the following notation.
A = B(i,:) * B';
I am familiar enough with matlab to understand most of its syntax so my question isn't about understanding what this expression is saying but rather the operation behind it.
For example if B = rand(10,3) what sequence of operations would produce the equivalent result for A to the above?
(I would like to unpack this so that I can build an equivalent function in C)

採用された回答

Image Analyst
Image Analyst 2017 年 10 月 21 日
To reproduce in C you'd need for loops. I believe this explains it:
B = rand(10,3);
i = 4; % Whatever....
% Method 1:
A = B(i,:) * B'
[rows, columns] = size(B)
% Method 2:
A2 = zeros(1, rows);
for row = 1 : rows
for col = 1 : columns
A2(row) = A2(row) + B(i, col) * B(row, col);
end
end
A2
% Check to make sure they're the same
% Will show 1 if they're equal.
isequal(A, A2)
  1 件のコメント
tree317
tree317 2017 年 10 月 21 日
Image Analyst,
Very very helpful - a sincere thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeR Language についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by