MATLAB: Is it possible to use the FILEPARTS function to return the current directory with the dot operator (‘.’) in MATLAB 7.8 (R2009a)

MATLAB

If I am in a folder which has child folders and am trying to use only the dot operator ('.') to represent the current directory for the path but am unasble to do that. I get back empty strings for all the 4 outputs:
Reproduction Steps:
[pathstr, name, ext, versn] = fileparts('.')
pathstr =
''
name =
Empty string: 1-by-0
ext =
.
versn =
''
I am buildig an application for my clients where I am not sure about the user input and believe it would be great if the dot operator can be used to represent the current directory and I could get back the name and path of the current directory when using the above command

Best Answer

The ability to use the FILEPARTS function to return the current directory details with the dot operator ('.') is not available in MATLAB 7.8 (R2009a).
As a workaround, the input CD can be used to access the contents of the current directory. For example:
[pathstr, name, ext, versn] = fileparts(cd)
Would return resutls that look like this:
pathstr =
T:\
name =
1-9LILT1
ext =
''
versn =
''