필터 지우기
필터 지우기

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
  댓글 수: 1
Anita
Anita 2011년 11월 30일
Thank you! It works now.

댓글을 달려면 로그인하십시오.

카테고리

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