Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Question about 'histc' expression
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
hello, i have a general question about the histogram function ('hist'/'histc').
i use a histogram to plot my data. my data are basically vectors of different length and i need to know how many of the vectors will contribute a value to each bin (in the first bins all vectors will contribute, whereas in the later ones, hardly any will contribute). i found some code from someones which addresses this problem and the script runs, but i don't quite understand what it exactly does and if it really does what i want. if someone could 'translate' the expression, i'd be really grateful:
p = (histc (ts, edges))/(length(ts)*binsize))
thanks a lot in advance!
1 comentario
Jan
el 27 de Oct. de 2011
Without seeing the definition of "edges", "ts" and "binsize" we had to guess. This will not be very helpful. Please edit your question and insert the necessary details.
Respuestas (2)
the cyclist
el 27 de Oct. de 2011
As Jan mentions, we don't have all the details, so there is some guessing involved, but here is what I would conclude based on what you have told us.
As you can learn from reading "doc histc", the histc() command is going to give bin counts based on your data (your variable "ts") and the definition of the bin edges (your variable "edges".)
This code looks like might be trying to convert those counts into some kind of normalized count, or possibly the probability density function, by dividing by the expected. It's not possible to be certain, without knowing what "binsize" is. If "p" always sums to approximately "1", then it's probably the pdf.
1 comentario
Jan
el 27 de Oct. de 2011
I still hope that some of the posters can be motivated to add the necessary details. So I did not dare to guess. You did. +1
Mary
el 28 de Oct. de 2011
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!