reduce rows of a due to b
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
JL
am 30 Aug. 2019
Beantwortet: Jos (10584)
am 30 Aug. 2019
Hi everyone, I have 2 matices, A and B
a = [0 1 0
0 1 1
1 0 1
1 1 1];
b =[1 1 1
0 1 1];
Is it possible to reduce a using b?
2 Kommentare
Akzeptierte Antwort
madhan ravi
am 30 Aug. 2019
ix = ismember(a,b,'rows');
a(ix,:) % gives you the rows in a which is common to b and ~ix vice versa
3 Kommentare
Weitere Antworten (1)
Jos (10584)
am 30 Aug. 2019
You can simply use setdiff with the rows option ...
c = setdiff(a,b,'rows')
0 Kommentare
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!