How to convert images folder to .mat

19 vues (au cours des 30 derniers jours)
abdullah al-dulaimi
abdullah al-dulaimi le 12 Juil 2022
I have this path ('C:\Users\hp\Desktop\testing\abood'), and i want to convert all images in this path to .mat file
  1 commentaire
Debadipto le 12 Juil 2022
Please refer to this answer. Hope this helps.

Connectez-vous pour commenter.

Réponses (1)

KSSV le 12 Juil 2022
Modifié(e) : KSSV le 12 Juil 2022
thepath = 'C:\Users\hp\Desktop\testing\abood' ;
imgFiles = dir([thepath,'\*jpg']) ; % give your image extension
N = length(imgFiles) ;
for i = 1:N
imgFile = fullfile(imgFiles(i).folder,imgFiles(i).name) ;
I = imread(imgFile) ;
[filepath,name,ext] = fileparts(imgFile) ;
fname = [thepath,filesep,name,'.mat'] ;
  7 commentaires
Bhagavathula Meena
Bhagavathula Meena le 24 Sep 2022
I have been searching for the same context to my work . Thank you very much . its working .

Connectez-vous pour commenter.


En savoir plus sur Convert Image Type dans Help Center et File Exchange



Community Treasure Hunt

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

Start Hunting!

Translated by