Input argument "" is undefined
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
0 commentaires
Réponses (1)
Hin Kwan Wong
le 30 Nov 2011
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
Voir également
Catégories
En savoir plus sur Numeric Types dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!