MATLAB Answers

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

4 views (last 30 days)
Mochammad Fariz
Mochammad Fariz on 17 Feb 2020
Answered: Jakob B. Nielsen on 17 Feb 2020
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

Sign in to comment.

Answers (1)

Jakob B. Nielsen
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');

  0 Comments

Sign in to comment.

Sign in to answer this question.


Translated by