Revision 1083, 455 bytes
(checked in by smidl, 14 years ago)
|
Mergers + fixes
|
Line | |
---|
1 | function h=epdf_1dplot(pdf,xlims, points) |
---|
2 | % function evaluates given pdf on support |
---|
3 | % xlims = [x_begin, x_end] --or-- empty |
---|
4 | % points = if not given, 100 |
---|
5 | |
---|
6 | if nargin<3 |
---|
7 | points = 100; |
---|
8 | end |
---|
9 | |
---|
10 | if nargin<2 | isempty(xlims) |
---|
11 | p_mean = epdf_mean(pdf); |
---|
12 | p_var = epdf_variance(pdf); |
---|
13 | xlims = p_mean(1)*[1 1] + [-3 3]*sqrt(p_var(1)); |
---|
14 | end |
---|
15 | |
---|
16 | steps = [xlims(2)-xlims(1)]; |
---|
17 | x = xlims(1):steps/(points-1):xlims(2); |
---|
18 | v = epdf_evallog_mat(pdf,x); |
---|
19 | h=plot(x,exp(v)); |
---|