Calling a function from a different directory
조회 수: 69 (최근 30일)
이전 댓글 표시
Hi
How can I put a function in a directory and use it in various other directories ?
댓글 수: 0
채택된 답변
Walter Roberson
2018년 1월 3일
Use addpath() to add the other directory to the MATLAB path.
You might potentially also want to know about 'private' functions https://www.mathworks.com/help/matlab/matlab_prog/private-functions.html or about https://www.mathworks.com/help/matlab/matlab_oop/scoping-classes-with-packages.html packages
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Search Path에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!