Why won't this function to generate a beta binomial distribution work?
3 次查看(过去 30 天)
显示 更早的评论
I am new to function writing and don't understand the error message I am getting when I try to run this function
function y=bbinopdf(x,n,a,b)
y= beta(x+a,n-x+b)/beta(a,b)
end
Define values as
x=[1:1:100];
a=1;
b=1;
n=10;
I can enter bbinopdf(x,n,a,b) with no error but then there is no output. If I use y=bbinopdf(x,n,a,b) I get
Error in bbinopdf (line 1)
function y=bbinopdf(x,n,a,b)
Output argument "y" (and maybe others) not assigned during
call to
"/Users/awetten/Documents/MATLAB/bbinopdf.m>bbinopdf".
Can anyone help- please?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Special Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!