write image names & details in excel file

3 次查看(过去 30 天)
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 中查找有关 Tables 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by