read number from file name leaving special characters

3 visualizaciones (últimos 30 días)
Oindri
Oindri el 14 de Mzo. de 2018
Comentada: KSSV el 14 de Mzo. de 2018
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.

Respuesta aceptada

KSSV
KSSV el 14 de Mzo. de 2018
Editada: KSSV el 14 de Mzo. de 2018
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 comentarios
Oindri
Oindri el 14 de Mzo. de 2018
Thanks. Anyways, I had to make some modifications.
KSSV
KSSV el 14 de Mzo. de 2018
fine..I hope your problem is solved....

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by