read number from file name leaving special characters

1 次查看(过去 30 天)
data_3dsar_pass1_az001_HH.mat
This is the filename. I need to read in the serial number at the end of the string. I have 360 such files starting from 001 to 360. how do i do it.

采纳的回答

KSSV
KSSV 2018-3-14
编辑:KSSV 2018-3-14
matfiles = dir('*.mat') ; % you are in the folder of mat files
N = length(matfiles) ; % total number of files
% loop for each file
for i = 1:N
thisfile = matfiles(i).name
% do what you want
end
  4 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by