Why am I getting undefined variable error?
Afficher commentaires plus anciens
Whenever I try to run my function, I keep getting "Undefined function or variable 'k'." error.
Undefined function or variable 'k'.
Error in @(x)-(k.^2)*cos(2.*pi.*k.*x./L)
However, k is one of the inputs to my function
[eN,uN] = femet(A1,k,L,u0,uL,N,dom,f,plott)
In the above line, "f" is a funcion handle, that uses k to define it, and when f comes into play in the code is when I get the error. Interestingly enough, whenever I run the code as a string (ie just assign all the "inputs" and run the code without the whole [out]=function[in] stuff) it runs fine. however, I need it to be a callable function :/
Thanks, Kevin
1 commentaire
dpb
le 2 Mar 2014
Think need to see in context...
Réponse acceptée
Plus de réponses (1)
Kevin
le 3 Mar 2014
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!