Borrar filtros
Borrar filtros

how can I draw histogram of a sine wave without "hist" command and with "plot" command?

2 visualizaciones (últimos 30 días)
I want to write a program to draw a histogram for sine wave without the "hist" command and draw its histogram with "plot" command. the number of Bins can be a constant number. or evenif I can define a function that its input are : the number of Bins and the signal varible. I don't know how , can any body help me?

Respuestas (1)

Walter Roberson
Walter Roberson el 9 de Mzo. de 2013
It can be done. You would need to use something like
plot( [1 1 2 2 3 3 4 4 5 5], [0 v1 v1 0 0 v2 v2 0 0 v3])
where v1, v2, v3 are the height values.
Have you considered using bar() instead of plot()

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