Applicantion path using a shortcut

1 view (last 30 days)
Rafael Gerges
Rafael Gerges on 18 Jun 2015
Edited: Image Analyst on 18 Jun 2015
Hi everybody
I developed an application and deployed using matlab application compiler. The main function needs to open a .txt file to read some parameters to use in the calculations. After installing the application, I run the executable file from the folder where it has been installed and the program runs ok. But when I try to run the executable from the shortcut, the application dont find the .txt file because the shortcut path is in a temporary path.
This is the code
[Dir]=cd;
cd(Dir);
[a Conf]=textread(fullfile(Dir,'config.dat'),'%s %s',4,'whitespace','\t');
I need the code to find the path where the application executable is and not the shortcut path.
Best regards.

Answers (1)

Image Analyst
Image Analyst on 18 Jun 2015
Edited: Image Analyst on 18 Jun 2015
See my attached utility to determine installation path from within your program.
It's for Windows only, and is based on code the Mathworks gave me.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!