(转)addpath matlab

addpath matlab

addpath -Add folders to search path

Alternatives

As an alternative to the addpath function, use the Set Path dialog box.

Syntax

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

Description

addpath('folderName1','folderName2','folderName3' ...) adds the specified folders to the top of the search path. Use the full path name for each folder. Use genpath with addpath to add all subfolders of folderName. Use addpath statements in a startup.m file to modify the search path programmatically at startup.

addpath('folderName1','folderName2','folderName3' ... flag) adds the specified folders to either the top or bottom of the search path,or disables folder change detection on Windows, depending on the value of position.

Value of Flag

Result

'-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). Type help changenotification in the Command Window for more information.

addpath folderName1 folderName2 folderName3 ... -flag is the command syntax.

previous_path = addpath(...) configures the path using the inputs and returns the previous path setting.

Tips

  • If you use addpath within a subfunction, the path change persists after program control returns from the function. That is, the scope of the path change is global, rather than local to the subfunction in which you change it.

Examples

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

Add myfiles and its subfolders to the search path:

addpath(genpath('c:/matlab/myfiles'))

On Windows, Add myfiles to the top of the search path, disable folder change notification, and display the search path before addingmyfiles:

previous = addpath('c:/matlab/myfiles', '-frozen')
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值