How can a function find location of itself?

59 Ansichten (letzte 30 Tage)
Micke Malmström
Micke Malmström am 13 Jun. 2016
Beantwortet: Walter Roberson am 13 Jun. 2016
I want to save a file in the same location as the a function (ie not in the current folder). How can a function find get the location of itself?
(the file should handle being moved around, additionally, it will always be in some PATH)

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 13 Jun. 2016
together with fileparts() to extract the directory portion, and fullfile() to construct the new file name.

Weitere Antworten (0)

Kategorien

Mehr zu File Name Construction finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by