Be the first to rate this file! 10 Downloads (last 30 days) File Size: 2.29 KB File ID: #40296
image thumbnail

Level folder string

by

 

13 Feb 2013 (Updated )

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

| Watch this File

File Information
Description

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.

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
14 Feb 2013 Nikolay S.

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!

13 Feb 2013 Jan Simon

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
14 Feb 2013

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

Contact us