error in betarnd function
이전 댓글 표시
I am using betarnd to generate beta distributed samples. However, sometimes the following error occurs.
" ??? Error using ==> binornd at 31 Size information is inconsistent.
Error in ==> betarnd at 44 r(t) = binornd(1,p,sum(t(:)),1); "
For example, using this line of code would sometimes produce the above error: betarnd([0.0001 0.0001 1],[0.0001 0.0001 1]).
Should line 44 of betarnd.m be "r(t) = binornd(1,p,1,sum(t(:)));" instead of "r(t) = binornd(1,p,sum(t(:)),1);"?
Thanks for your help.
답변 (1개)
Shashank Prasanna
2013년 2월 26일
This is indeed a bug in betarnd which existed in releases prior to MATLAB R2011a.
If you are using an older release you are right about the fix as well.
>> edit betarnd
and replace Line 44 with
>> r(t) = binornd(1,p(:),sum(t(:)),1);
카테고리
도움말 센터 및 File Exchange에서 Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!