matlaboctave

List of all built-in symbols in Matlab/Octave


In Mathematica one can get the names of all built-in functions starting with, for instance, List by executing the command

Names["List`*"]

In addition

Names["context`*"] 

lists all symbols in the specified context. E.g.

Names["Global`*"] 

gives the names of all the built-in symbols (as well those defined by the user in Global context if any).

Are there similar structures in Matlab/Octave?


Solution

  • In Octave you can use the following functions:

    __operators__              : Undocumented
    __keywords__               : Undocumented
    __builtins__               : Undocumented
    __list_functions__         : Return a list of all functions (.m and .oct functions) in the load path or in the specified directory.
    localfunctions             : Return a list of all local functions, i.e., subfunctions, within the current file.
    

    And undocumented function __dump_symtab_info__ that dumps symbol table that contains function and variable names in different scopes:

    __dump_symtab_info__ (scope)               : Dump symbol table of the given scope
    __dump_symtab_info__ (__current_scope__)   : Dump symbol table of the current scope
    __dump_symtab_info__ ("functions")         : Dump globally visible functions from symbol table
    __dump_symtab_info__ ("scopes")            : List available scopes
    __dump_symtab_info__ ()                    : Everything