how to save looping data ?

how to save looping data, I have data that consists of 6 years, I process using for-end. but I have trouble storing each data in the form of year_2014 to year_2019.
fileList1 = getAllFiles('D:\MATLAB\change\data maximu\*.xls');
[nn, mm] = size(fileList1);
for jj= 1:nn;
jj;
fname=fileList1{jj} ;
FILE_NAME = sprintf('%s%s',fname(1:29),fname(36:end));
[data, txt,all] = xlsread(FILE_NAME);
.
.
.
.
year_2014 = [ ]
dlmwrite('year_2014.txt',year_2014, 'delimiter', '\t', 'precision', 8, '-append')
end
and only one year is saved, thank you for the advice given to my program thank you

Respuestas (1)

KALYAN ACHARJYA
KALYAN ACHARJYA el 2 de Ag. de 2019
Editada: KALYAN ACHARJYA el 2 de Ag. de 2019

0 votos

data_file=cell(1,nn);
for jj= 1:nn;
%......
[data, txt,all] = xlsread(FILE_NAME);
%...........^ change this variable name, check @Madhan's comment
data_file{ii}=data
%.....
end

1 comentario

madhan ravi
madhan ravi el 2 de Ag. de 2019
Don't use all as a variable name , will hinder the inbuilt function all() .

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 2 de Ag. de 2019

Editada:

el 2 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by