Creating a histogram

Hi,
Is the correct syntax to create a histogram of data X with 22 bins the following
hist(X,22)
When I type it noting happens?

 Respuesta aceptada

Wayne King
Wayne King el 31 de Mzo. de 2012

0 votos

That is correct. When you say "nothing happens", do you mean that the line of code executes, but no figure is produced? If so, try
clf;
X = randn(1000,1);
hist(X,22);

3 comentarios

John
John el 31 de Mzo. de 2012
Thanks - Yes, no figure is produce,
clf RESET gives this error though?
??? Error using ==> clo at 32
Unknown command option.
Error in ==> clf at 80
clo(fig, extra{:});
John
John el 31 de Mzo. de 2012
Got it working, thanks
Wayne King
Wayne King el 31 de Mzo. de 2012
yea, sorry about that! I fixed that :)

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 31 de Mzo. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by