Anonymous user
Include a file: Difference between revisions
→{{header|MATLAB}} / {{header|Octave}}: Include source files
(Explain LabVIEW's differences) |
(→{{header|MATLAB}} / {{header|Octave}}: Include source files) |
||
Line 121:
<lang Mathematica> Get["myfile.m"] </lang>
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:
<lang MATLAB>
% add a new directory at the end of the path
path(path,newdir);
addpath(newdir,'-end'); % same as above
% add a new directory at the beginning
addpath(newdir);
path(newdir,path); % same as above
</lang>
=={{header|Modula-2}}==
|