Why am I getting undefined variable error?
Mostra commenti meno recenti
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 Commento
dpb
il 2 Mar 2014
Think need to see in context...
Risposta accettata
Più risposte (1)
Kevin
il 3 Mar 2014
Categorie
Scopri di più su Common Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!