Effacer les filtres
Effacer les filtres

write image names & details in excel file

2 vues (au cours des 30 derniers jours)
revathi t
revathi t le 15 Sep 2015
Modifié(e) : Renato Agurto le 15 Sep 2015
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.

Réponse acceptée

Renato Agurto
Renato Agurto le 15 Sep 2015
Modifié(e) : Renato Agurto le 15 Sep 2015
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

Plus de réponses (1)

Walter Roberson
Walter Roberson le 15 Sep 2015
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()

Community Treasure Hunt

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

Start Hunting!

Translated by