Anonymous user
Include a file: Difference between revisions
→{{header|MATLAB}} / {{header|Octave}}: fix header
(→{{header|MATLAB}} / {{header|Octave}}: Include source files) |
(→{{header|MATLAB}} / {{header|Octave}}: fix header) |
||
Line 122:
<lang Mathematica> Get["myfile.m"] </lang>
=={{header|Matlab}} / {{header|Octave}}==
Matlab and Octave look for functions in *.m and *.mex included in the "path".
New functions can be included, either by storing a new function in an existing path, or by extending the existing path to a new directory. When two functions have the same name, the function found first in the path takes precedence. The later is shown here:
Line 128 ⟶ 129:
% add a new directory at the end of the path
path(path,newdir);
addpath(newdir,'-end'); % same as
% add a new directory at the beginning
addpath(newdir);
path(newdir,path); % same as
</lang>
=={{header|Modula-2}}==
|