문제

I am trying to deploy a simple console application using MATLAB Compiler.

However, we can't use addpath() in deploying applications.

I would like to know, how can we add a subfolder containing functions and data files and later how to use them.

Possible answer to access a file would be:

fp = fopen(fullfile(ctfroot, 'my', 'data', 'directory', 'data.file'));

However, this doesn't explain how to add path to access those functions in a subdirectory.

도움이 되었습니까?

해결책

As addpath is not supported in the deploytool, you should add the files in your source files while you are trying to build an executable. If for some reason you don't want to add the entire data (maybe too big?), you can then provide only the data path as input. Then read the data files from that path. If you do this, be careful when you distribute the application.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top