Is it possible to determine within a function the location of that function?

1 view (last 30 days)
Is it possible to determine the location (folder consisting that function) of a used function within the function?
I dont want to change the current folder just know the function folder within the function.

Accepted Answer

Stephen23
Stephen23 on 27 May 2020
Edited: Stephen23 on 27 May 2020
p = mfilename('fullpath')
[p,n] = fileparts(p)

More Answers (0)

Categories

Find more on File Name Construction in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!