MATLAB Answers

plot probability density function

7 views (last 30 days)
Hisham
Hisham on 17 Oct 2012
Hi all, I've tried to plot probability density for a give diagram but I could not reach the same figure as in the book.
I attached a picture for the question.
Here is the data on X-axis
0-5000
5000-10000
10000-15000
15000-20000
20000-25000
25000-30000
30000-35000
35000-40000
40000-45000
45000-50000
50000-55000
55000-60000
The corresponding data on Y-axis:
8
9
8
13
8
5
1
3
2
1
1
1

  1 Comment

Wayne King
Wayne King on 17 Oct 2012
Please show the code that you have tried.

Sign in to comment.

Accepted Answer

venkat vasu
venkat vasu on 17 Oct 2012
Hi...
This code surely will help you.
a=5000:5000:60000;
b=[8 9 8 13 8 5 1 3 2 1 1 1]
bar(a,b);
or
stem(a,b);

  3 Comments

Hisham
Hisham on 17 Oct 2012
That is good for the left part of the attached picture (histogram).
But How about the probability density function (on the right part of the picture?
waiting for your helps :)
Thanks!
venkat vasu
venkat vasu on 17 Oct 2012
Hi... check this for second plot
a=5000:5000:60000;
b=[8 9 8 13 8 5 1 3 2 1 1 1]
scatter(a,b); hold on
plot(a,b,'m');
Hisham
Hisham on 17 Oct 2012
Actually is not similar to the curve as in the attached picture. I think the curve is plotted by using the probability density function, but I don't know how can I use it?

Sign in to comment.

More Answers (3)

Hisham
Hisham on 17 Oct 2012
any help please?

  0 Comments

Sign in to comment.


Hisham
Hisham on 17 Oct 2012
Up....

  0 Comments

Sign in to comment.


Qura
Qura on 1 Apr 2013
How can calculate propability density function of image without using imhist command or own code

  0 Comments

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!