Find location of current m-file in MATLAB -
i'm working on matlab code in number of different locations, , if make code aware of location on computer. think there function gives me information, can't remember called or find on google.
the idea have function myfunc
needs file in own directory, can in different locations on different computers. in myfunc
want this:
dir = thefunctionimlookingfor; system(fullfile(dir, 'someapp.exe'));
(it function i'm looking doesn't return directory, directory + m-file name, makes little difference me.)
mfilename or better mfilename('fullpath')
Comments
Post a Comment