How to do set subtraction
62 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have two array a=[1,2,3] and b=[2,3,4,5]
I need a array c=b\a. Here \ is the set subtract operation. result is as follows:
i.e.c=[4,5]
How to do that in matlab. Thanks in advance.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Vishal Rane
am 12 Dez. 2012
Use
c = b(~ismember(b,a))
although there might be more simpler way to do this.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Environment and Settings 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!