[matlab][solution] Get file directory or extension of file

By.

min read

My profile

Share this:

Use fileparts and you will get the directory without using any / or explode usage.

[code:1:059164e278]>> fullpath
fullpath = /home/user/www/site/trunk/tempuploads/test/174_bw_tractsresize.png

>> [pathstr, name, ext] = fileparts(fullpath)

pathstr =
/home/user/www/site/trunk/tempuploads/test

name =
174_bw_tractsresize

ext =
.png[/code:1:059164e278]

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *