MCR addpath thirdparty toolbox

2 次查看(过去 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:
Usage: ./run_image_reconstruction.sh deployedMCRroot args
  1 个评论
Adam
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
  • 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:

类别

Help CenterFile Exchange 中查找有关 Search Path 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by