Indigo
Indigo

Reputation: 2997

Adding subfolder path in deployed application

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.

Upvotes: 1

Views: 1490

Answers (1)

Autonomous
Autonomous

Reputation: 9075

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.

Upvotes: 1

Related Questions