how to add multiple rows into xlsx file???

hello all.... can any one plz tell me how to add multiple rows into xlsx sheet,now m using this code.. values = {area(i),Length,width,Perimet(i),AspectRat,FormFact(i),Entropy,Contrast,Energy,stats1.Homogeneity,green,lumi}; headers = {'Area','Length','width','perimet','Aspectrat','Form_factor','Entropy','Contrast','Energy','homogen','Green','Lumin'}; xlswrite('extract.xlsx', [headers; values]);
but this is displaying only one row(last image value) this is overwriting the last value so response me soon,thank you.....

5 Comments

What are the i's, where did they come from? I'm assuming you're looping? If so, you need to post all of them for us to be able to help.
i's are the i'th values of.....
subplot(1,2,1),%imshow(im); BW1=im2bw(rgb2gray(im7),0.35); BW1=imfill(BW1,'holes'); BW1=imopen(BW1,ones(5));subplot(1,2,2);%imshow(BW1,[0 1]); [L,num]=bwlabel(BW1); s=regionprops(L,'area','perimeter'); for i=1:num area(i)=s(i).Area; Perimet(i)=s(i).Perimeter; FormFact(i)=4.*pi.*area(i)./(Perimet(i).^2); disp(area(i));%this is the i'th value I need to store in xlsx file disp(Perimet(i));%this is the i'th value I need to store in xlsx file disp(FormFact(i));%this is the i'th value I need to store in xlsx file end %display(FormFact(i)); %============================================================ BW1=im2bw(rgb2gray(im7),0.35); BWao = bwareaopen(BW1,2000); %figure,imshow(BWao); %h=msgbox('4'); nhood = true(9); closeBWao = imclose(BWao,nhood); %figure,imshow(closeBWao); %h=msgbox('5'); roughMask = imfill(closeBWao,'holes'); I2=im7; I2(roughMask)=0; E2 = entropyfilt(I2); E2im = mat2gray(E2); Entropy=entropy(E2im);%=============================entropy display(Entropy); %=====================statistical features================================
J = rgb2gray(im7);
%calculationg gray level co occurance matrix(glcm) of image for texture
%anlysis of image for default offset, i.e., 0 degree
glcm1 = graycomatrix(J ,'offset', [0 3]);
%extracting the properties from above glcm
stats1= graycoprops(glcm1,{'contrast','correlation','energy','homogeneity'});
imgcharecter(1,1)= stats1.Contrast;
imgcharecter(1,2)= stats1.Correlation;
imgcharecter(1,3)= stats1.Energy;
imgcharecter(1,4)= stats1.Homogeneity;
disp(stats1);
sir thank you for response.....
Please format your code properly... I don't like having to read walls of unformatted text.
subplot(1,2,1),%imshow(im);
BW1=im2bw(rgb2gray(im7),0.35);
BW1=imfill(BW1,'holes');
BW1=imopen(BW1,ones(5));
subplot(1,2,2);%imshow(BW1,[0 1]);
[L,num]=bwlabel(BW1);
s=regionprops(L,'area','perimeter');
for i=1:num
area(i)=s(i).Area;
Perimet(i)=s(i).Perimeter;
FormFact(i)=4.*pi.*area(i)./(Perimet(i).^2);
disp(area(i));
disp(Perimet(i));
disp(FormFact(i));
end

Answers (0)

This question is closed.

Asked:

on 30 Jan 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!