MCR addpath thirdparty toolbox

2 vues (au cours des 30 derniers jours)
Golam Chowdhury
Golam Chowdhury le 24 Mai 2017
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:
Usage: ./run_image_reconstruction.sh deployedMCRroot args
  1 commentaire
Adam
Adam le 24 Mai 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.

Connectez-vous pour commenter.

Réponses (1)

Nagarjuna Manchineni
Nagarjuna Manchineni le 26 Mai 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:

Catégories

En savoir plus sur Search Path dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by