行列の計算について
3 views (last 30 days)
Show older comments
行列A(n行3列)と行列B(m行3列)があります(n>m)。行列Bは行列Aに属する行列です。
ここで、行列Aから行列Bを除いた行列Cを求めたいのですが、どのようなコードでしょうか。
以下イメージです。

行列Aは点群データとして扱っており、処理によって検出した行列Bと検出されなかった
行列Cを別のデータとして処理したいので質問させて頂きます。
どうぞ宜しくお願い致します。
0 Comments
Accepted Answer
michio
on 15 Jan 2017
ismember関数 が使えるかなと。
以下のサンプルコードを実行してみてください。
%サンプルデータ作成
% 点群 B,C
B = rand(5,3);
C = rand(5,3);
% 点群 A
A = [C; B];
% 点群 A の中から 点群 B を検出
index = ismember(A,B,'rows');
% B 以外、すなわち C を抽出
CfromA = A(~index,:);
% 確認
C
CfromA
2 Comments
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!