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!