MATLAB: How to find out the full path for a directory

MATLAB

I have the name of a directory, but I would like to find out its full path. How can I do that?

Best Answer

You can use the "what" command.  Please refer to the documentation here: <http://www.mathworks.com/help/matlab/ref/what.html>
 
>> s = what('myDir');
>> s.path
ans =
C:\path\to\myDir