How to get part of information for specified file in MatLab? - fileparts -- MatLab

 How to get part of information for specified file in MatLab - fileparts -- MatLab


How to get part of information for specified file in MatLab?

[Ans]
fileparts

[Description]
Get file parts of specified file.
Get part of information of specified file.

[<filepath>,<name>,<ext>] = fileparts(<file>)

It will return 3 arguments.
<filepath> means path of <file>.
<name> means name of <file>.
<ext> means extension of <file>.

more details on:

code:
clear
clc
file = "H:\user4\matlab\myfile.txt";
[filepath,name,ext] = fileparts(file)


output:


filepath =

""


name =

"H:\user4\matlab\myfile"


ext =

".txt"

Comments

Popular posts from this blog

How to join a file path with multiple char vector or string in MatLab? - fullfile -- MatLab