大伙儿们好,请问假如我不知道某个文件的后缀名,但是我要写个函数来获取这个文件的后缀名,请问怎么做?

 Accepted Answer

0 votes

s=dir('C:\Windows'); %C:\Windows 你文件的绝对路径
[~,a,b]=fileparts(s(4).name) %红色的4,看看你的文件是哪个

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!