MATLAB: How to find the directory the script or function running now is

MATLABpath

I am running a script and i want to know the path it is with out using the script name.
The path is in 'matlabpath' so by using pwd i can get a different path. It is exist a way to know the directory of the running script or function(In running i mean that i what to use the command in the script to get the answer)?

Best Answer

doc mfilename
Related Question