Is there anyway to get the folder location where the executable is running ?
Ältere Kommentare anzeigen
I want to create an executable which grabs files in the same directory where the executable is running and process it accordingly . I used in the code 'pwd' command to get the current folder location, but when the executable is created Matlab hardcodes the current folder location of my working directory and packages it .Thus i am not able to deploy my tool .
Antworten (3)
Adam Filion
am 16 Okt. 2013
0 Stimmen
Image Analyst
am 16 Okt. 2013
Bearbeitet: Image Analyst
am 16 Okt. 2013
I believe it's in the system variable called ctfroot.
root = ctfroot returns a string that is the name of the folder where the CTF file for the deployed application is expanded.
2 Kommentare
Saurabh PATIL
am 16 Okt. 2013
Image Analyst
am 16 Okt. 2013
Bearbeitet: Image Analyst
am 16 Okt. 2013
cd or pwd is not a reliable and robust way of getting the folder of the executable since the current folder may be changed by code within the executable. Then you might try mfilename('fullpath').
Stefanie Schwarz
am 21 Okt. 2024
0 Stimmen
See also:
How can I find the directory containing my compiled application?
Kategorien
Mehr zu MATLAB Compiler finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!