How to count the frequency of repeated values in an array of values with the index position?
2 次查看(过去 30 天)
显示 更早的评论
clc
clear
t=0:.001:10;
y=sin(2*pi*t);
I want to count the frequency of repeated values in 'y' . How can I do that? I also want to print out the index position where value is being repeated.
Thanks!
0 个评论
采纳的回答
the cyclist
2019-9-28
Be aware, though, that due to accuracy of floating point numbers, you may not get exact repeated values when you expect them.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!