Standalone exe: how to change uigetdir to avoid the dependency of the path ?

1 view (last 30 days)
Hallo there,
I'm currently trying to built a standalone exe from my Matlab programm. Unfortunately I am using the path to different files/folders in my Matlab code and I know that this is not possible for a standalone exe. Is there an easy way to change this?
Thank you for your help!

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 3 Jun 2016
One thing to remember is that if you load() or imread() a file using a pathname that is not an absolute pathname, then in a standalone executable, the first place that it is going to check for the file is ctfroot(), and it will check there before looking at the MATLAB path. Therefore if you have read-only files and folders you can add them to the project and use them as-if they are in your current directory. If you need to write temporary files use tempdir() and tempname(); if you need to write permanent files then you start running into difficulty.

Sign in to comment.

More Answers (0)


Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!