how to fine repeated value?

in a column if there is 100 vlaues some are repeated and nonrepeated values how to fine repeated values, how many times it is repeated .
how to get this is there any matlab instruction r code?

Respuestas (1)

Rik
Rik el 21 de Mzo. de 2020

0 votos

If you just wanted to know the repeated values you could use unique to filter each first occurrence, which would leave the repeated values.
As you want to know how often every value occurs the most logical step would be to histcounts. Use max and min to determine the bin edges.

5 comentarios

rajesh kumar
rajesh kumar el 21 de Mzo. de 2020
ex: 1045, 1234,1871, 1078, 1078,1089, 1078, 1342, 1678,1099.
in this 10 values repeated value is 1078 it is 3 times.
i want the value and how many time it is repeated
is there any matlab code.
Rik
Rik el 21 de Mzo. de 2020
Have you tried using the histcounts function?
Walter Roberson
Walter Roberson el 21 de Mzo. de 2020
histcounts and look for entries whose count is more than 1.
rajesh kumar
rajesh kumar el 21 de Mzo. de 2020
x = randn(100,1);
y = randn(100,1);
[N,Xedges,Yedges] = histcounts2(x,y)
N =
0 0 0 2 0 0
1 2 10 4 0 0
1 4 9 9 5 0
1 4 10 11 5 1
1 4 6 3 1 1
0 0 1 2 0 0
0 0 1 0 1 0
Xedges =
-3 -2 -1 0 1 2 3 4
Yedges =
-3 -2 -1 0 1 2 3
i am not understanding this one, what is edges, bins, what is N how this obtains what is represents i am not understanding
Walter Roberson
Walter Roberson el 21 de Mzo. de 2020
This does not appear to relate to the original question: the probability of a repeated value created by randn() is very low -- you would have to generate more than 1e8 samples for the probability of even one duplicate to reach 50%.

La pregunta está cerrada.

Productos

Versión

R2016a

Etiquetas

Preguntada:

el 21 de Mzo. de 2020

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by