read number from file name leaving special characters

조회 수: 1 (최근 30일)
Oindri
Oindri 2018년 3월 14일
댓글: KSSV 2018년 3월 14일
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
Oindri
Oindri 2018년 3월 14일
Thanks. Anyways, I had to make some modifications.
KSSV
KSSV 2018년 3월 14일
fine..I hope your problem is solved....

댓글을 달려면 로그인하십시오.

추가 답변 (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