Function handles as function output
Ältere Kommentare anzeigen
function main
f = test(pi);
f(1)
end
function f = test(v)
A = v;
f = @(x) A*x;
end
In the above code, how is A saved? When f(1) gets evaluated in main-fcn, where does A come from? Is it saved in f or grabed from test workspace or something else?
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 5 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 5 Mär. 2013
0 Stimmen
A is v, you do not need to get A
Kategorien
Mehr zu Variables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!