MCR addpath thirdparty toolbox
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I am using a custom made matlab program, but it uses additional scripts that I placed in sub-directory, in addition to it, I am using some toolboxes. The program uses the sub-routines in the toolboxes that are placed in many (sub)-directories. I would like to preserve the directory structure in my program. When I compile using addpath command and submit to a cluster, the program is terminated stating that sub-routines are not accessible. I have used
if ~isdeployed addpath('some-directory') end
but does not solve the problem. Any clue how to successfully run it, after compilation together with preserving the directory structure, rather than copying all the routines in the same folder?
I get this error:
1 件のコメント
Adam
2017 年 5 月 24 日
Can you not just add the sub directories to your path in the normal manner, permanently, rather than doing it in code in the program itself?
If they are dependencies of your program though they should get automatically picked up and added into the code structure that is replicated on the target machine.
回答 (1 件)
Nagarjuna Manchineni
2017 年 5 月 26 日
- If you are directly calling (not by 'eval(....functionName....)' or constructing function file path in a string and calling the function etc..) the functions directly in your code then MATLAB dependency analyzer will add those functions in the deployed application.
- If you are not calling the functions in the program directly, then try attaching those files/directory while compiling the MATLAB code either by using '-a' flag or by adding them to "Files required for your application to run" section of the compiler application. Using this the files will be available when the application is deployed and also the directory structure is retained (relative path).
Refer to the following documentation link for more information:
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!