problems with my code
1 view (last 30 days)
Show older comments
Hi,
I am running a monte carlo simulation of 12 runs and the last piece of my code (find below) is suppose to calculate PDF and CDF for the RL_MC_1 outputs. The problem that i am facing is the following:
RL_MC_1 is a matrix 378x12 size so i am expecteing a PDF1 and BCC1 matrices of same size, however i am always getting 378x10 size for these two, not sure what is wrong.
for kk = 1:length(RL_MC_1)
[n1(kk,:),bincenters1(kk,:)] = hist(RL_MC_1(kk,:));
PDF1(kk,:)=n1(kk,:)/length(RL_MC_1(kk,:));
BCC1(kk,:)= cumsum(PDF1(kk,:));
end
1 Comment
Geoff Hayes
on 28 May 2019
Priscilla - have you tried putting a breakpoint at the line
PDF1(kk,:)=n1(kk,:)/length(RL_MC_1(kk,:));
to see what the dimensions are for PDF1, n1, and RL_MC_1?
Answers (0)
See Also
Categories
Find more on NaNs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!