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 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by