Nesting function trouble with undefined variable
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
KL
el 19 de Nov. de 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);
Categorías
Más información sobre Entering Commands 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!