How do you remove elements (all the same number), randomly dispersed, from a (vertical) vector?
Ältere Kommentare anzeigen
For instance, I have the following (vertical) vector x = [100 4 5 6 100 2 100 7 4 100 2]'
100 4 5 6 100 2 100 7 4 100 2
I want to remove the 100(s) from this vector to get
4 5 6 2 7 4 2
Is there a way to do that? If so, what is the code to do that?
Antworten (3)
Image Analyst
am 18 Feb. 2013
x(x==100)=[];
Youssef Khmou
am 18 Feb. 2013
Bearbeitet: Youssef Khmou
am 18 Feb. 2013
hi, try this :
x(x==100)=[];
Andrei Bobrov
am 18 Feb. 2013
out = x(abs(x - 100) > eps(100));
Kategorien
Mehr zu Aerospace Blockset finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!