关于matlab获取文件后缀名的问题。

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

 Risposta accettata

0 voti

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

Più risposte (0)

Categorie

Community Treasure Hunt

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

Start Hunting!