Creating a histogram

4 views (last 30 days)
John
John on 31 Mar 2012
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?

Accepted Answer

Wayne King
Wayne King on 31 Mar 2012
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 Comments
John
John on 31 Mar 2012
Got it working, thanks
Wayne King
Wayne King on 31 Mar 2012
yea, sorry about that! I fixed that :)

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!