Nesting function trouble with undefined variable
Mostra commenti meno recenti
Trying to code a simple nesting function and I can't understand why I get an undefined function or variable warning for 'a'
function [Y] = nesty(d,e)
Y(d,e)=2*a;
nestmini
function [a] = nestmini(d,e)
a=d+e;
end
end
Risposta accettata
Più risposte (1)
KL
il 19 Nov 2017
You're passing d,|e| to nesty function but you're using a on the right hand side of the equation. Do not expect matlab to call the nestmini function for you.
If you want to use the function return directly, try something like,
Y(d,e) = 2*nestmini(d,e);
Categorie
Scopri di più su Entering Commands 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!