Borrar filtros
Borrar filtros

code for plotting more than one histogram in MATLAB

35 visualizaciones (últimos 30 días)
Oluwaseun
Oluwaseun el 26 de Sept. de 2011
Comentada: Mauricio Cabrera el 3 de Nov. de 2021
Hi; I am new to MATLAB and i have this question to ask: is it possible for one to write a code in MATLAB such that different histograms(say more than two) are plotted and shown on the screen at the same time?
Thank you in anticipation of your response.
Simon.

Respuestas (1)

Aurelien Queffurust
Aurelien Queffurust el 26 de Sept. de 2011
subplot should achieve what you want :
x = -4:0.1:4;
y = randn(1000,2);
figure
subplot(2,1,1)
hist(y(:,1),x)
subplot(2,1,2)
hist(y(:,2),x)
  1 comentario
Mauricio Cabrera
Mauricio Cabrera el 3 de Nov. de 2021
Gracias me ayudo, cabe destacar que ahora la función hist() se está actualizando por histrogram(). Saludos.

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by