How can a function find location of itself?

49 visualizzazioni (ultimi 30 giorni)
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)

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su File Name Construction in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by