Matlab设置永久path

1. 加入文件夹搜索路径 — addpath

ddpath('folderName1','folderName2','folderName3' ...)
addpath('folderName1','folderName2','folderName3' ... flag)
addpath folderName1 folderName2 folderName3 ... -flag)
previous_path = addpath(...)

这里的flag为

  • ‘-begin’ :Add specified folders to the top of the search path.
  • ‘-end’ :Add specified folders to the bottom of the search path.
  • ‘-frozen’ :Disables change detection for folders you add to the path, which conserves Windows change notification resources (Windows only). Typehelp changenotification in the Command Window for more information.

例子:
Add c:/matlab/myfiles to the top of the search path:

addpath('c:/matlab/myfiles')

Add c:/matlab/myfiles to the end of the search path:

addpath c:/matlab/myfiles -end

2. 加入文件夹及其下子文件夹 —addpath(genpath(‘c:/matlab/myfiles’))
如:Add myfiles and its subfolders to the search path:
On Windows, Add myfiles to the top of the search path, disable folder change notification, and display the search path before adding myfiles:

previous = addpath('c:/matlab/myfiles', '-frozen')

3. 去除文件夹搜索路径 rmpath

  • rmpath(‘folderName’) removes the specified folder from the search path . Use the full path forfolderName.
  • rmpath folderName is the command form of the syntax.

4. 永久添加到搜索路径

  1. pathtool/菜单: File -> Set Path
  2. 修改Matlab 相关配置文件pathdef.m % 位于 $MATLAB\toolbox\local\
  3. 先使用 path 或addpath 命令将指定的目录加入到当前搜索路径中,然后使用 saveptah 命令将当前搜索路径写入pathdef.m
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: