How to write multiple data in an excel file in .xls/.csv format using xlsappend function.

1 Ansicht (letzte 30 Tage)
I want to store a data of 105*150 in a single excel file. I have 150 files. Each image file provides 105 features in a single iteration. xlswrite function gives 150 distrinct excel files. Altghough, I need one excel output file. I used xlsappend function but it yields a single excel file with one rows. How it can be overcomed.
  2 Kommentare
Jan
Jan am 15 Apr. 2018
Post your code. How could we suggest a modification without seeing the current version? In addition you mention "xlsappend", but this is not a toolbox function of Matlab. Do you mean the submission from the FileExchange?
I guess, that you create a new file name in each iteration instead of using the same file.
Jhilam Mukherjee
Jhilam Mukherjee am 16 Apr. 2018
Yes, I download the code from FileExchange. featuremeasurement=regionprops(I{i},K{i},'all'); n=size(featuremeasurement, 1); %figure,imshow(K),title('Segmented Image'); hold on; boundaries = bwboundaries(K{i}); b = bwboundaries(K{i}); R=zeros(10,10); numberOfBoundaries = size(b, 1); for k=1:numberOfBoundaries thisBoundary = boundaries{k}; plot(thisBoundary(:,2), thisBoundary(:,1), 'g', 'LineWidth', 2); %m = mean(K(thisnodulePixels)); % Find mean intensity (in original image!) %F(k) = extractHOGFeatures(K) a(k)= featuremeasurement(k).Area; % Get area. p(k) = featuremeasurement(k).Perimeter; % Get perimeter. e(k) = featuremeasurement(k).Eccentricity; %Get Shape factor ECD(k) = sqrt(4 * a(k) / pi); % Compute ECD - Equivalent Circular Diameter. %compute compactness FA(k)=featuremeasurement(k).FilledArea; EU(k)=featuremeasurement(k).EulerNumber; maxl(k)=featuremeasurement(k).MajorAxisLength; minl(k)=featuremeasurement(k).MinorAxisLength; aspect_ratio(k)=minl(k)/maxl(k); Cir(k)=(4*pi*a(k)/p(k)^2); bobox(k)=featuremeasurement(k).Extent; cp(k)=(4 * a(k) * pi)/p(k)^2; SF1(k)=1/(cp(k)); SF2(k)=maxl(k)/a(k); SF3(k)=a(k)/maxl(k)^3; SF4(k)=a(k)/((maxl(k)/2)*(minl(k)/2)*pi); aa(k)=a(k)-FA(k); IrA(k)=p(k)/a(k); IrB(k)=p(k)/maxl(k); IrC(k)=p(k)*(1/minl(k)-1/maxl(k)); IrD(k)=maxl(k)-minl(k); X(k)=maxl(k)*minl(k); EV(k)=((rem(X(k),6))+2)/100; % compute Edge variation %C(k,:)= %fprintf(1,'%2d%8.4f%8.4f%8.4f %8.4f %8.4f %8.4f %8.4f %8.4f %8.4f %8.4f\n ',k,frac,sol(k),shape(k), cp(k),IrA(k),IrB(k),IrC(k),IrD(k),EV(k)); % texture Feature %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% E(k) = entropy(K{i}); st(k)=std2(K{i}); XX=graycomatrix(K{i},'Offset',[2 0]); tx(k)=graycoprops(XX,'All'); con(k)=tx(k).Contrast; cor(k)=tx(k).Correlation; en(k)=tx(k).Energy; ho(k)=tx(k).Homogeneity; [~, AOH, PhiOH] = Zernikmoment(K{i},4,2); R=[a(k),p(k),ECD(k),maxl(k),minl(k),aspect_ratio(k),Cir(k),cp(k),SF1(k),SF2(k),SF3(k),SF4(k),IrA(k),IrB(k),IrC(k),IrD(k),X(k), EV(k),E(k),st(k),con(k),cor(k),en(k),ho(k),AOH]; [success,message] = xlsappend('C:\Users\acer\Dropbox\feature15\feature.xls',R,1); clear vars; end

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by