clc; clear all; close all; A_folder = dir('E:\Notes\SEM 7\PRML\Alphabet Database\A\*.png'); B_folder = dir('E:\Notes\SEM 7\PRML\Alphabet Database\B\*.png'); C_folder = dir('E:\Notes\SEM 7\PRML\Alphabet Database\C\*.png'); D_folder = dir('E:\Notes\SEM 7\PRML\Alphabet Database\D\*.png'); E_folder = dir('E:\Notes\SEM 7\PRML\Alphabet Database\E\*.png'); A_result=cellmat(1,length(A_folder),32,32); B_result=cellmat(1,length(B_folder),32,32); C_result=cellmat(1,length(C_folder),32,32); D_result=cellmat(1,length(D_folder),32,32); E_result=cellmat(1,length(E_folder),32,32); m=100; for i=1:m A_result(1,i)=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\A\',A_folder(i).name)); B_result(1,i)=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\B\',B_folder(i).name)); C_result(1,i)=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\C\',C_folder(i).name)); D_result(1,i)=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\D\',D_folder(i).name)); E_result(1,i)=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\E\',E_folder(i).name)); end My database contains 100 greyscale images. I need to convert them into matrices with each cell containing a matrice of uint8 form of each image.
John Williams answered .
2025-11-20
for i=1:m
A_result{1,i}=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\A\',A_folder(i).name));
B_result{1,i}=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\B\',B_folder(i).name));
C_result{1,i}=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\C\',C_folder(i).name));
D_result{1,i}=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\D\',D_folder(i).name));
E_result{1,i}=imread(strcat('E:\Notes\SEM 7\PRML\Alphabet Database\E\',E_folder(i).name));
end