Revision 803, 451 bytes
(checked in by smidl, 15 years ago)
|
new wrappers in bdmtoolbox + display functions
|
Line | |
---|
1 | function 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 | plot(x,exp(v)); |
---|