matlab:matlab_path
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
matlab:matlab_path [2019/07/10 11:50] – [startup.m] igorkagan | matlab:matlab_path [2022/12/29 07:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
==== startup.m ==== | ==== startup.m ==== | ||
- | When MATLAB starts, it will look for a **pathdef.m** file in its startup directory. It should not be edited - leave the default MATLAB path containing only MATLAB native toolboxes. The rest should be configured dynamically, | + | When MATLAB starts, it will look for a **pathdef.m** file in its startup directory. It should not be edited - leave the default MATLAB path containing only MATLAB native toolboxes. The rest should be configured dynamically, |
- | Start up folder (in the MATLAB icon | Properties | Start in ) (e.g. D:\Sources\MATLAB) allows controlling different paths and other settings via startup.m file placed in the folder, | + | If a custom **startup.m** is found on the path, it will be executed: https:// |
+ | |||
+ | There are __two ways__ to configure place the startup.m on the path: | ||
+ | |||
+ | 1. Custom startup | ||
+ | |||
+ | 2. Place custom startup.m to your [[https:// | ||
+ | (type ' | ||
+ | |||
+ | For example, a minimal **startup.m** for automatically including all GitHub repositories (but excluding not needed internal | ||
<code matlab> | <code matlab> | ||
- | disp('Welcome to physiology analysis...'); | + | addpath(genpath_exclude('YOUR_PATH_TO_REPOS','.git' |
- | set_sources_path; | + | </ |
- | % addpath(genpath(' | + | |
- | cd('F:\Data'); | + | **Note:** [[https:// |
- | edit; | + | |
- | EditorMacro('Alt-Control-h', | + | Example startup.m for GitHub repositoriesand Fieldtrip and NeuroElf from DAG server (Y:): |
+ | |||
+ | <code matlab> | ||
+ | disp('Welcome to YOUR MATLAB VERSION, e.g. MATLAB2014a' | ||
+ | addpath(genpath_exclude(' | ||
+ | addpath(' | ||
+ | ft_defaults | ||
+ | |||
+ | % http:// | ||
+ | [ftver, ftpath] = ft_version; | ||
+ | rmpath(fullfile(ftpath, | ||
+ | rmpath(fullfile(ftpath, | ||
+ | rmpath(fullfile(ftpath, | ||
+ | |||
+ | addpath(' | ||
dbstop if error | dbstop if error | ||
</ | </ | ||
- | See https:// | + | |
+ | ---- | ||
+ | |||
+ | See also https:// | ||
+ | |||
+ | <code matlab> | ||
+ | disp(' | ||
+ | set_sources_path; | ||
+ | edit; | ||
+ | EditorMacro(' | ||
+ | dbstop if error | ||
+ | </ | ||
+ | |||
+ | The function **set_sources_path.m** can be something like the one below, to add all repositories but exclude not needed internal | ||
+ | |||
+ | <code matlab> | ||
+ | addpath(genpath_exclude(' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== pathdef.m ==== | ||
+ | |||
+ | When MATLAB gives an " | ||
+ | [[https:// | ||
+ |
matlab/matlab_path.1562759447.txt.gz · Last modified: 2022/12/29 07:15 (external edit)