how remove frequent values?
1 次查看(过去 30 天)
显示 更早的评论
hi,
is there a command can remove frequent values from vector?
thanks
采纳的回答
Jan
2011-11-17
x = floor(rand(1, 100)*10);
[N, Bin] = histc(x, unqiue(x));
Now you can use sort(N) to find the most frequent elements. Then you can search the corrsponding indices in Bin.
2 个评论
Walter Roberson
2011-11-17
You probably do not need to use both sort _and_ unique: unique does a sort.
更多回答(1 个)
Walter Roberson
2011-11-17
To remove the most frequent value, and assuming it is a vector you are working with:
x(x==mode(x)) = [];
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!