Why am I getting undefined variable error?
Mostrar comentarios más antiguos
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 comentario
dpb
el 2 de Mzo. de 2014
Think need to see in context...
Respuesta aceptada
Más respuestas (1)
Kevin
el 3 de Mzo. de 2014
Categorías
Más información sobre Common Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!