フィルターのクリア

open image in a folder and save outputted data in excel with the same name as image

2 ビュー (過去 30 日間)
Tian Tian
Tian Tian 2017 年 8 月 31 日
コメント済み: Tian Tian 2017 年 9 月 15 日
Hi, I am trying to open images from a folder one by one and do processing, afterwards i hope to save output in an created excel with the same name as this image. My current code for opening image is:
for k=1:numel(files)
fullFileName = fullfile(folder, files{k})
cellArrayOfImages{k}=imread(fullFileName);
afm = image(cellArrayOfImages{k});
excelfilename = fullfilename.xlsx;
writetable(T,excelfilename,'Sheet',1,'Range','A1')
end
Could anyone help me to point out the mistake and give me some ideas how to correct it? Thank you.

採用された回答

KSSV
KSSV 2017 年 9 月 1 日
folder = pwd ; % give your path
files = [folder filesep '*.jpg'] ; % give extension of images
files = dir(files) ; % get all image files in the folder
N = length(files) ;
for k=1:N
fullFileName = fullfile(folder, files(k).name) ;
cellArrayOfImages=imread(fullFileName);
afm = image(cellArrayOfImages);
[pathstr,name,ext] = fileparts(fullFileName) ;
excelfilename = strcat(pathstr,name,'.xlsx') ;
writetable(T,excelfilename,'Sheet',1,'Range','A1')
end
  3 件のコメント
Tian Tian
Tian Tian 2017 年 9 月 1 日
Another thing is I couldn't find the created excel file. Is Matlab that supposed to create an excel file with the same name with image and store data there, right? Thanks.
Tian Tian
Tian Tian 2017 年 9 月 15 日
Thanks a lot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Export to MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by