With the octave hist function, I'm calculating approximate probability
density functions for some experimental data, and it is working well.
To get the cumulative distribution function from the probability
distribution, I reverted to my Fortran roots and wrote
% calculate cdf from pdf
sum_pdf=0;
for i = 1:num_bins
sum_pdf=sum_pdf+pdf(i);
cdf(i)=sum_pdf;
end
which also works well.
Question: is there a way of calculating cdf without resorting to the for
loop? The for loop approach seems very un-octave to me.
Obviously, this is not urgent, but perhaps educational.
Joe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------