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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by