File Exchange

image thumbnail

Level folder string

version 1.1 (2.29 KB) by

The function returns user chosen level folder name out of path provided.

0 Downloads

Updated

View License

Folder name usually carries some description of the files stored in the folder. However, it is sometimes interesting to use the name of a folder on a higher level. This function returns the string user chosen level folder, eliminating the need to present the whole path in cases it is obsolete.

Comments and Ratings (2)

Nikolay S.

Nikolay S. (view profile)

Hi Jan Simon.
Thanks for the comment.
Indeed you're correct. I thought that '.' (dot) is an illegal character in folder name. Apparently I was wrong. I did some fix which works for actual files- uploading it now. For a case where a arbitrary string is used it seems that this function should receive a path to a folder rather then a file until I'll find a way to distinguish between file and folder.
Best wishes!

Jan Simon

Jan Simon (view profile)

Even folder names can contain a dot, so it is not a fair limitation to assume, that the existence of a dot means that the input is a file.

Updates

1.1

Fixed the dot based distinguish between file name and folder name according to a comment.

MATLAB Release
MATLAB 8.0 (R2012b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video