How can i add new value into next row in excel?
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
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
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!