Open files from documents in loop
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I want to open several files in a for loop.
Anyone who can help me with this?
For now I tried this:
a = "/Users/diontheunissen/Documents/Smart_Driver/RawData/Scania/e-"
b = r
c = ".csv"
filename = strcat(a,b,c);
filename = convertCharsToStrings(filename);
truck1 = readtable(filename, opts);
How can I make r the variable (1 to 20)?
1 comentario
Chunru
el 21 de Oct. de 2021
a = "/Users/diontheunissen/Documents/Smart_Driver/RawData/Scania/e-";
c = ".csv";
for r=1:20
filename = sprintf('%s%d%s', a, r, c);
disp(filename)
%truck1 = readtable(filename, opts);
end
Respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!