Include a file: Difference between revisions

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 abovebefore
 
% add a new directory at the beginning
addpath(newdir);
path(newdir,path); % same as abovebefore
</lang>
 
 
 
=={{header|Modula-2}}==
Anonymous user