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

Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 2 Aug. 2019
Bearbeitet: KALYAN ACHARJYA am 2 Aug. 2019

0 Stimmen

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 Kommentar

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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 2 Aug. 2019

Bearbeitet:

am 2 Aug. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by