1,855
edits
(finding source: no need for regular expression, and shouldn't have ^) |
(Add Category:Development some extensions.) |
||
Line 1: | Line 1: | ||
== ''How can I find which file implements a given command?'' == | |||
From within Octave, use ' | From within Octave, use <code>which</code>: | ||
<syntaxhighlight lang="Octave"> | |||
>> which help | |||
</syntaxhighlight> | |||
'help' is a function from the file /some/path/m/help/help.m | |||
If the desired function is a m-file, one can simply edit it inside the GUI, just type: | |||
<syntaxhighlight lang="Octave"> | |||
>> edit help | |||
</syntaxhighlight> | |||
Some functions are already compiled (a.k.a. ''built-in functions''), for example: | |||
<syntaxhighlight lang="Octave"> | |||
>> which addpath | |||
</syntaxhighlight> | |||
'addpath' is a built-in function from the file libinterp/corefcn/load-path.cc | |||
This function is to be found in Octave's source code, in this case at [https://hg.savannah.gnu.org/hgweb/octave/file/b33d4fbce33e/libinterp/corefcn/load-path.cc#l2355]. | |||
If the source code is cloned to a local machine, you can edit the repective file and search for something like "<code> (addpath,</code>". | |||
[[Category:Development]] |