Dave
Dave

Reputation: 8091

Getting documentation from a function handle

Generically, if I have a function handle (but not the function name), is there a way to see the "help" comment block associated with that function?

Upvotes: 3

Views: 52

Answers (1)

Oleg
Oleg

Reputation: 10676

Convert the handle to a string with func2str() and call help() on it:

f = @sum;
help(func2str(f))

You might need to regexp() the string, if you have an anonymous function.

Upvotes: 5

Related Questions