Input argument "" is undefined

1 次查看(过去 30 天)
Anita
Anita 2011-11-30
My problem arises when I run the following piece of code:
theta=[psi;s_u;b];
[theta_to , f_to , cov_to] = maximize(@p_11,theta,2,1,0);
I get this error message:
??? Undefined function or method 'p_11'
for input arguments of type 'double'.
I have made sure that all my functions are in the same library. When I try to call p_ll, I get the following error message:
??? Input argument "theta" is
undefined.
Error in ==> p_ll at 3
psi=theta(1)
The p_ll function looks like this:
function ll=p_ll(theta)
global R N T x y u
psi=theta(1);
s_u=theta(2);
b=theta(3:end);
ll=zeros(N,1);
[S_AR, A]=p_S_AR(T, psi, s_u);
for i=1:N
xb_i=x((i-1)*T+1:i*T,:)*b;
y_i=y((i-1)*T+1:i*T);
ll(i)=log(p_lli(T, R, y_i, xb_i, A, u(:,:,i)));
end
It may be trivial but I cannot find my mistake(s). Does anyone have an idea?

回答(1 个)

Hin Kwan Wong
Hin Kwan Wong 2011-11-30
function ll=p_ll(theta)
is p_ll with letter L not number ONE
maximize(@p_11,theta,2,1,0);
you put it as p_11 with number ONE

类别

Help CenterFile Exchange 中查找有关 Numeric Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by