How to auto change save file name with For loop

2 visualizaciones (últimos 30 días)
minsick
minsick el 8 de Abr. de 2020
Comentada: minsick el 8 de Abr. de 2020
I am looking for how to auto change save file name with For loop
N = 6;
for k = 1:N
F = sprintf('RR.data.%u',k);
C{k} = dlmread(F)
data = vertcat(C{:}); % <-- data is input
% After processing
%
% processing output is result
result = output % <-- how to auto change save file name with For loop
The result files overlap. that is why i ask
  2 comentarios
Guillaume
Guillaume el 8 de Abr. de 2020
I don't understand your question. Your code doesn't save anything. On the other hand, you're reading files whose name you're already changing.
It's also unclear why the vertcat(C{:}) is inside the k loop and what 'output of data' mean.
minsick
minsick el 8 de Abr. de 2020
I changed something please reconfirm. That is just example. I am looking for how to auto change save file name

Iniciar sesión para comentar.

Respuestas (1)

Aoi Midori
Aoi Midori el 8 de Abr. de 2020
Do you mean this?
result(k) = output

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by