How to exclude specific values from a vector?

31 Ansichten (letzte 30 Tage)
Louis
Louis am 10 Jun. 2013
Kommentiert: Mehri Mehrnia am 17 Aug. 2021
I have two arrays of unmatching sizes.
For example: A=[1;2;3;4;5;7;14;76;89] B=[2;3;14]
What I would like as an output is a new vector which has all the values from A excluding values from B. So C=[1;4;5;7;76;89] I am unable to overcome unmatching dimension issues with my basic matlab skills :(
Any help would be really appreciated!

Akzeptierte Antwort

Iain
Iain am 10 Jun. 2013
C = setdiff(A,B);

Weitere Antworten (0)

Kategorien

Mehr zu Performance and Memory 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!

Translated by