How do you remove elements (all the same number), randomly dispersed, from a (vertical) vector?
이전 댓글 표시
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?
답변 (3개)
Image Analyst
2013년 2월 18일
x(x==100)=[];
Youssef Khmou
2013년 2월 18일
편집: Youssef Khmou
2013년 2월 18일
hi, try this :
x(x==100)=[];
Andrei Bobrov
2013년 2월 18일
out = x(abs(x - 100) > eps(100));
카테고리
도움말 센터 및 File Exchange에서 Aerospace Blockset에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!