Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to make the folders correspond to suitable files depending on its similar names

2 visualizaciones (últimos 30 días)
I have folders' names in a variable nameFolds1("DYT" "HC9" "HC" "MS_3R" "MS" "PN5_3R" "T"). The 'files' variable contains names of files(like DYT02_OFF,HC907,HC505,MS010_3R,MS010,PN532_3R,T27).
So each folder name should head the corresponding list of files. With DYT, HC9, HC and T it's easy, because I can just use the startswith function.
The problem with MS_3R and PN5_3R, that its files have some numbers before the _ sign(e.g. MS010_3R and PN532_3R). If somebody knows how to deal with it, answer me please.
for i = 1:Numb_of_folds
pattern = nameFolds1(i);
TF = startsWith(files,pattern);
Z = files(TF);
files(ismember(files,Z)) = [];
s = size(Z);
Z = cellstr(Z.');
fprintf(fid1,'%s\r\n',Z{:});
fprintf(fid1,'\n');
end

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by