Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
faq:should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path [2018/07/06 11:31]
robert [Should I add FieldTrip with all subdirectories to my MATLAB path?]
faq:should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path [2018/07/06 11:34] (current)
robert [Should I add FieldTrip with all subdirectories to my MATLAB path?]
Line 4: Line 4:
 In general you should **not** add FieldTrip with all subdirectories to your path. There are a number of external toolboxes (in fieldtrip/​external) which are irrelevant for most users, and even can cause some problems if they overlap with other (custom) toolboxes on your path. Furthermore,​ there are some functions for backward compatibility in fieldtrip/​compat,​ which should only be added to your path in case you use an older MATLAB release. In general you should **not** add FieldTrip with all subdirectories to your path. There are a number of external toolboxes (in fieldtrip/​external) which are irrelevant for most users, and even can cause some problems if they overlap with other (custom) toolboxes on your path. Furthermore,​ there are some functions for backward compatibility in fieldtrip/​compat,​ which should only be added to your path in case you use an older MATLAB release.
  
 +<note warning>
 +Please be aware that you should NOT do 
 +  addpath(genpath('/​home/​user/​fieldtrip'​))
 +because that will add many toolbox directories to your path that you won't use. Furthermore,​ it potentially causes some toolboxes to be on your path twice (e.g. SPM).  ​
 +</​note>​
 +
 +==== Step 1 ====
 You should do  You should do 
   addpath <​full_path_to_fieldtrip>​   addpath <​full_path_to_fieldtrip>​
Line 13: Line 20:
   addpath D:​\fieldtrip-20100228   addpath D:​\fieldtrip-20100228
  
-After adding the fieldtrip ​main path, you should execute the **[[:​reference:​ft_defaults]]** function (formerly called fieldtripdefs.m),​ which sets the defaults and configures up the minimal required path settings. ​+==== Step 2 ==== 
 + 
 +After adding the FieldTrip ​main path, you should execute the **[[:​reference:​ft_defaults]]** function (formerly called fieldtripdefs.m),​ which sets the defaults and configures up the minimal required path settings. ​
  
   ft_defaults   ft_defaults
Line 19: Line 28:
 If a subsequent FieldTrip function need an external toolbox that is present in fieldtrip/​external,​ the **[[:​reference:​ft_hastoolbox]]** function will be called by the respective function and the path will be updated on the fly. If a subsequent FieldTrip function need an external toolbox that is present in fieldtrip/​external,​ the **[[:​reference:​ft_hastoolbox]]** function will be called by the respective function and the path will be updated on the fly.
  
-It is most convenient to have the addpath and **[[:​reference:​ft_defaults]]** in a startup.m script, which is located in your own MATLAB directory. See [[http://​www.mathworks.com/​access/​helpdesk/​help/​techdoc/​ref/​startup.html|this information from Mathworks]].+==== Making it persistent ====
  
-<note warning>​ +It is most convenient ​to have the addpath and **[[:​reference:​ft_defaults]]** in a script with the name **startup.m**which is located in your own MATLAB directorySee [[http://​www.mathworks.com/access/​helpdesk/​help/​techdoc/​ref/​startup.html|this information from Mathworks]]. 
-Please be aware that you should NOT do  + 
-  addpath(genpath('/​home/​user/​fieldtrip'​)) +==== Clean up your path ====
-because that will add many toolbox directories ​to your path that you won't useFurthermoreit potentially causes some toolboxes to be on your path twice (e.gSPM)  +
-</note>+
  
 If you want to ensure that you have a clean version of the FieldTrip toolbox on your MATLAB path, please do If you want to ensure that you have a clean version of the FieldTrip toolbox on your MATLAB path, please do