How can i add new value into next row in excel?

조회 수: 5 (최근 30일)
Mochammad Fariz
Mochammad Fariz 2020년 2월 17일
댓글: Mochammad Fariz 2020년 5월 16일
im working with color feature extraction ..and i have 27 color type..i was created the gui to extract color feature from image and store those value to excel..i have 2 rows and 27 columns ..first row is header (title)..second row is value of header..but whenever i run the gui with new image it will always overwrite the values from C4 cells to AC4..
i want to make it whenever i run the gui ,browse image and extract colour feature ..it will store in excel and fill in next row (for example C5 to AC 5,run GUI again fill to C6 to AC6,run GUI again fill to C7 to AC 7 etc)
i have no idea with that..please anybody help me..

답변 (1개)

Jakob B. Nielsen
Jakob B. Nielsen 2020년 2월 17일
A simple solution: define a counter file that pertains to your GUI - lets call it rownumber. Save it manually the first time, to be rownumber=4; for example. Then:
rownumber=load('insertpathhere.mat');
myranges=['A',num2str(rownumber),':AC',num2str(rownumber)];
%code code code
%then, in the end:
rownumber=rownumber+1;
save('insertpathhere.mat','rownumber');
  댓글 수: 2
Nur Syarah Hani Ahmad Fitri
Nur Syarah Hani Ahmad Fitri 2020년 5월 16일
hey jakob i think i got the idea of your solution but i cant manage to apply in my code
meanpca1= mean(mean(pca1Image,1),2);
meanpca2= mean(mean(pca2Image,1),2);
meanpca3= mean(mean(pca3Image,1),2);
d = {'PCA 1','PCA 2', 'PCA 3'; meanpca1, meanpca2, meanpca3};
filemeanpca=xlswrite('filemeanpca.xlsx',d);
so the first row i did it like this then so it worked and if if i repeat this method it will overwrite the current value so i basically wanted meanpca1, meanpca2, meanpca3 will insert into a new row every time i want to run a different images so that i can keep track the data.
im currently using matlab r2016a
Mochammad Fariz
Mochammad Fariz 2020년 5월 16일
thx guys problem solved

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by