How to see function body in GNU Octave

octave

Solution

For displaying the content of any function, use the type function:

    >> function y = f(x); y = x; endfunction;
    >> type ("f")
    f is the command-line function:

    function y = f (x)
      y = x;
    endfunction

Problem

Is there a way in GNU Octave to print source code of a user-defined function? For example, I've defined a function in the interactive prompt: ``` octave:nn> function y = f(x); y = x; endfunction; ``` Now is there a way to look up this function definition later in the prompt? Something like ``` octave:nn> showsource("f") ans = function y = f(x); y = x; endfunction; ```

Original source