IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]How to add a path to matlab search path permanently

    bendanban发表于 2016-10-18 14:06:16
    love 0

    Here are two steps to add your own path to matlab search path permanently.

    addpath your/path
    savepath

    help of the two command in matlab:

    savepath

    savepath saves the current MATLABPATH in the pathdef.m
    which was read on startup.
    
    savepath outputFile saves the current MATLABPATH in the
    specified file.
    
    savepath returns:
      0 if the file was saved successfully
      1 if the file could not be saved

    addpath

     addpath DIRNAME prepends the specified directory to the current
     matlabpath.  Surround the DIRNAME in quotes if the name contains a
     space.  If DIRNAME is a set of multiple directories separated by path
     separators, then each of the specified directories will be added.
    
     addpath DIR1 DIR2 DIR3 ...  prepends all the specified directories to
     the path.
    
     addpath ... -END    appends the specified directories.
     addpath ... -BEGIN  prepends the specified directories.
     addpath ... -FROZEN disables directory change detection for directories
                         being added and thereby conserves Windows change
                         notification resources (Windows only).
    
     Use the functional form of addpath, such as addpath('dir1','dir2',...),
     when the directory specification is stored in a string.
    
     P = addpath(...) returns the path prior to adding the specified paths.
    
     Examples
      addpath c:\matlab\work
      addpath /home/user/matlab
      addpath /home/user/matlab:/home/user/matlab/test:
      addpath /home/user/matlab /home/user/matlab/test


沪ICP备19023445号-2号
友情链接