write image names & details in excel file
조회 수: 1 (최근 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.
댓글 수: 0
채택된 답변
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
댓글 수: 0
추가 답변 (1개)
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()
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!