MATLAB Answers

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

4 views (last 30 days)
Molly
Molly on 3 Jun 2016
Commented: Molly on 7 Jun 2016
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!
  2 Comments

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.
  5 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!