oddity with displaying function handles

In Matlab version 9.1, observe:
>> f = @(x)(1);
>> f = @(x)(f(x)+1)
f =
function_handle with value:
@(x)(f(x)+1)
>> f(5)
ans =
2
The oddity is: when f itself is displayed, the symbol 'f' appearing inside the display refers to an older version of f rather than the current version. Is there a way to see what is 'really' inside the function handle?

답변 (1개)

Walter Roberson
Walter Roberson 2017년 3월 5일

0 개 추천

In a situation such as that,
s = functions(f)
s.workspace{1}.f

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

질문:

2017년 3월 5일

답변:

2017년 3월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by