1

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

yes, that worked, I just had to use isdeployed function while in matlab and add folder to deployment project to build.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.