genpath2

버전 1.0.0 (1.98 KB) 작성자: Santiago Sordo-Palacios
genpath2 calls genpath and removes folders matching a specified pattern
다운로드 수: 96
업데이트 날짜: 2021/2/7

Description
MATLAB's genpath(folderName) creates a character vector containg the path to folderName and any of its subfolders. genpath excludes folders starting with @, +, private, and resource, but it does not allow users to specify other patterns to exclude from its output.

This can cause problems when users addpath using the output of genpath. For one, it becomes more difficult to parse the output of path because many potentially unused folders are now on the file path. And similarly, it can lead to frequent folder handle notifications from MATLAB as it searches through unusued folders for files--especially when using busy network drives.

This is where genpath2 comes in. Inspired by Jesse Hopkins's genpath_exclude, genpath2 is a wrapper for genpath (instead of a standalone function) that executes genpath and then removes folders from its output matching a specified pattern.

Usage
genpath2(folderName) returns a vector identical to genpath(folderName)
genpath2(folderName, '.git') returns a vector without folders starting with .git
genpath2(folderName, {'.git', '.svn'}) returns a vector without folders starting with .git or .svn

Contributing
Original Author: Santiago I. Sordo-Palacios
If you find a bug or would like to add a feature, please open and issue and submit a pull request via the GitHub Project. I do not monitor comments on the MATLAB File Exchange.

인용 양식

Santiago Sordo-Palacios (2024). genpath2 (https://github.com/ssordopalacios/matlab-genpath2), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2019a
R2016b에서 R2019a까지의 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Search Path에 대해 자세히 알아보기
태그 태그 추가
도움

받음: genpath_exclude

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.