MCR addpath thirdparty toolbox
1 view (last 30 days)
Show older comments
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 Comment
Adam
on 24 May 2017
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.
Answers (1)
Nagarjuna Manchineni
on 26 May 2017
- 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 Comments
See Also
Categories
Find more on Search Path in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!