write image names & details in excel file

조회 수: 2 (최근 30일)
revathi t
revathi t 2015년 9월 15일
편집: Renato Agurto 2015년 9월 15일
For a single input image, I have got 2 volumes by means of using 2 separate algorithms. Say v1 & v2 for image I. How do I write these details in tabel/excel file? Like
S.No,Image_name,Volume1,Volume2,Volume_difference=(yes|no)
Likewise I should write the details of the images I use as Input.

채택된 답변

Renato Agurto
Renato Agurto 2015년 9월 15일
편집: Renato Agurto 2015년 9월 15일
You can use a cell to save strings and numbers for your excel table:
for i = 1:N
% Get image info...
%for example:
image_no = i;
image_name = ['figure' num2str(i) '.jpg'];
v1 = get_volume1(image_name);
v2 = get_volume2(image_name);
A{i,1} = image_no;
A{i,2} = image_name;
A{i,3} = v1;
A{i,4} = v2;
if v1 == v2
A[i,5} = 'yes';
else
A[i,5} = 'no;
end
end
%Write excel table
xlswrite('out.xlsx', A);
If course you can get the image name from an array. You can also write the titles in the first row:
A(1,:) = {'No.' , 'Image_name', 'Volume1', 'Volume2', 'Volume_difference'};
I hope this is want you are looking for

추가 답변 (1개)

Walter Roberson
Walter Roberson 2015년 9월 15일
If you have R2013b or later see table() and writetable(). As of R2014a writetable can only generate text tables including csv but as of R2014b it can handle xls
Otherwise build a cell array and use xlswrite()

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by