行列の計算について
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ichiro Suzuki
am 14 Jan. 2017
Kommentiert: michio
am 16 Jan. 2017
行列A(n行3列)と行列B(m行3列)があります(n>m)。行列Bは行列Aに属する行列です。
ここで、行列Aから行列Bを除いた行列Cを求めたいのですが、どのようなコードでしょうか。
以下イメージです。

行列Aは点群データとして扱っており、処理によって検出した行列Bと検出されなかった
行列Cを別のデータとして処理したいので質問させて頂きます。
どうぞ宜しくお願い致します。
0 Kommentare
Akzeptierte Antwort
michio
am 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!