行列の計算について
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
行列A(n行3列)と行列B(m行3列)があります(n>m)。行列Bは行列Aに属する行列です。
ここで、行列Aから行列Bを除いた行列Cを求めたいのですが、どのようなコードでしょうか。
以下イメージです。

行列Aは点群データとして扱っており、処理によって検出した行列Bと検出されなかった
行列Cを別のデータとして処理したいので質問させて頂きます。
どうぞ宜しくお願い致します。
0 commentaires
Réponse acceptée
michio
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!