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

 采纳的回答

0 个投票

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

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Adding custom doc 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!