Skipping through multiple histograms - one at a time?

2 views (last 30 days)
Dear all,
I am searching for an elegant way to skip thorugh multiple histograms.
I am having a matrix B of size 250x95 which includes 95 different times series with 250 observations. To investigate the series, I want to plot the 95 different time series as a histogram, each one at a time. However I would like to have a coding which enables me to see the first histogram at the beginning and then by my intervention skipping to the next one, and then to the third one and so forth.
I know that I could put down hist(B(:,i)) and then for the index i the respective time series, however I know that it is possible to incorporate a kind of skipping function into a for loop which exactly enables me to move from the first index value to the second and so on. I have seen it at a presentation, however couldn't get the coding for it. :(
As I said, as far as I know is that it was done with a for loop. So to say:
for i =1:95
hist(B(:,i))
<--- some kind of command here
end
Will be thankful for any help.

Accepted Answer

Sean de Wolski
Sean de Wolski on 20 Feb 2015
Edited: Sean de Wolski on 20 Feb 2015
The simplest way: Insert a pause() which waits for keyboard input:
for ii = 1:10
hist(randn(1000,1));
pause
end
Now hit any key when you're done.
Of course you could build a more fancy utility for this (like a pushbutton on the figure etc.)

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!