Function handles as function output
古いコメントを表示
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?
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2013 年 3 月 5 日
編集済み: Azzi Abdelmalek
2013 年 3 月 5 日
0 投票
A is v, you do not need to get A
カテゴリ
ヘルプ センター および File Exchange で Variables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!