Can I use ADDPATH in a compiled application from MATLAB Compiler 4.10 (R2009a)?
1 回表示 (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2011 年 6 月 20 日
回答済み: Rahul Goel
2017 年 8 月 16 日
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 で Search Path についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!