How can we define equally- ranged bins in histogram?

1 visualización (últimos 30 días)
ishita agrawal
ishita agrawal el 25 de Ag. de 2017
Comentada: Star Strider el 25 de Ag. de 2017
Hi, Thank you for responding my previous questions. I have a dataset containing values between 0 to 1. I want to plot a histogram for bin ranges 0:0.1:1, i.e. [0-0.1, 0.1-0.2, 0.2-0.3......0.9-1.0]. Can anybody help with this? Thank you in advance.

Respuesta aceptada

Star Strider
Star Strider el 25 de Ag. de 2017
The easiest way is to use linspace, choose the minimum and maximum values, and select the vector length to be one more than the number of bins (here 10) to define the edges:
edges = linspace(0, 1, 11);
  2 comentarios
ishita agrawal
ishita agrawal el 25 de Ag. de 2017
Thank you for the answer. For my case, 0-1 is working fine.
Star Strider
Star Strider el 25 de Ag. de 2017
My pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by