Can I use ADDPATH in a compiled application from MATLAB Compiler 4.10 (R2009a)?
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 20 Giu 2011
Risposto: Rahul Goel
il 16 Ago 2017
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.
Risposta accettata
MathWorks Support Team
il 20 Giu 2011
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 Commento
raym
il 29 Mag 2017
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?
Più risposte (1)
Rahul Goel
il 16 Ago 2017
Hi Mendel, In terms of compiled exe, ctfroot will point to the root directory of the extracted cache of the deployed component.
0 Commenti
Vedere anche
Categorie
Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!