日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

添加当前文件夹及其子文件夹到以及别而的文件夹到当前路径

發布時間:2025/4/16 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 添加当前文件夹及其子文件夹到以及别而的文件夹到当前路径 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

addpath(genpath(pwd)),代表當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')

總結

以上是生活随笔為你收集整理的添加当前文件夹及其子文件夹到以及别而的文件夹到当前路径的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。