How to export multiple tables within a cell array with a foor loop

1 visualización (últimos 30 días)
Hello, I have a cell-array with 1xn tables within it. I would like to export every table as a seperate .csv file which has the running table number in its name.
So for exaple table {1,1} should be named 'measurement_1_table.csv', table {1,2} ' measurement_2_table.csv' and so on.
How can I do this in a for-loop?

Respuesta aceptada

Jan
Jan el 27 de Mzo. de 2021
Folder = 'C:\Where\To\Write';
for k = 1:numel(YourCell)
File = fullfile(Folder, sprintf('measurement_%d_table.csv', k));
writetable(YouCell{k}, File);
end

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by