i want to know how many times a value repeated in excel
Mostrar comentarios más antiguos
i have an excel file that has only numbers on it, and i want to know how many times a value repeated Example: 1 2 3 4 5 5 5 6
here 5 has been repeated 3 times, how can i find that by matlab?
Respuestas (2)
Thomas
el 6 de Nov. de 2012
If you know which value you want to find the count of
a=[1 2 3 4 5 5 5 6]; % input values
numberofFives=sum(a==5)
7 comentarios
Mohammed
el 6 de Nov. de 2012
Thomas
el 6 de Nov. de 2012
then use
[count , number]=hist(a,unique(a));
[number' count']
Mohammed
el 6 de Nov. de 2012
Thomas
el 6 de Nov. de 2012
then read on XLSREAD, import data into matlab and use
[count , number]=hist(a,unique(a));
morethan1=find(count>1);
[number(morethan1)' count(morethan1)']
Mohammed
el 6 de Nov. de 2012
Thomas
el 6 de Nov. de 2012
a=[1 2 3 4 5 5 5 6]; % a was your input series of numbers
Mohammed
el 8 de Nov. de 2012
Matt J
el 6 de Nov. de 2012
0 votos
Read the data in using XLSREAD. Then use HISTC.
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!