How to do set subtraction
65 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Più risposte (1)
Vishal Rane
il 12 Dic 2012
Use
c = b(~ismember(b,a))
although there might be more simpler way to do this.
0 Commenti
Vedere anche
Categorie
Scopri di più su Environment and Settings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!