Вопрос

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