FUNCTION REFERENCE

func2str

Return the text of a function handle.

Return the text of a function handle.

Syntax

s = func2str(f)

For a named handle the result is the function name; for an anonymous function it is the full text starting with @.

Example

func2str(@(x) x.^2 + 1)   % '@(x)x.^2+1'

Differences from MATLAB: Anonymous function text is rebuilt from the parsed tokens, so spacing can differ from what was typed.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.