Can I use ADDPATH in a compiled application from MATLAB Compiler 4.10 (R2009a)?
조회 수: 4 (최근 30일)
이전 댓글 표시
My MATLAB program contain ADDPATH commands that refer to MATLAB files located in another directory. I would like to know if my compiled application will be able to mirror the directory structure if I provide it relative paths.
채택된 답변
MathWorks Support Team
2011년 6월 20일
This change has been incorporated into the documentation in Release 2011a (R2011a). For previous releases, read below for any additional information:
It is not recommended to use ADDPATH in a deployed application. As a workaround, use paths relative to MATLABROOT or CTFROOT.
For example, change code like this:
addpath(my/data/directory)
fp = fopen('data.file', 'r');
To code like this:
fp = fopen(fullfile(ctfroot, 'my', 'data', 'directory', 'data.file'));
댓글 수: 1
raym
2017년 5월 29일
what dose ctfroot mean in terms of compiled exe file? the path of that exe file? So 'my', 'data', 'directory' should be placed immediately in the same foder?
추가 답변 (1개)
Rahul Goel
2017년 8월 16일
Hi Mendel, In terms of compiled exe, ctfroot will point to the root directory of the extracted cache of the deployed component.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!