How can i add new value into next row in excel?
5 views (last 30 days)
Show older comments
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..
0 Comments
Answers (1)
Jakob B. Nielsen
on 17 Feb 2020
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 Comments
Nur Syarah Hani Ahmad Fitri
on 16 May 2020
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
See Also
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!