folder1 = 'C:\Users\Degebassa\Documents\MATLAB\train\train_normal';
files1 = dir(fullfile(folder1,'*.png'));
numFiles1 = numel(files1);
images1 = cell(numFiles1,1);
filename = fullfile(folder1,files1(i).name);
images1{i} = imread(filename);
folder2 = 'C:\Users\Degebassa\Documents\MATLAB\train\train_abnormal';
files2 = dir(fullfile(folder2,'*.png'));
numFiles2 = numel(files2);
images2 = cell(numFiles2,1);
filename = fullfile(folder2,files2(i).name);
images2{i} = imread(filename);
minClass = min(numFiles1, numFiles2);
numToAdd = numFiles1 - minClass;
indices = resample(1:numFiles2, numToAdd, 'Replace', true);
images2 = images2(indices);
images = [images1; images2];
outputFolder = 'C:\Users\Degebassa\Documents\MATLAB\resampled images';
imwrite(images{i}, fullfile(outputFolder, sprintf('image%d.png', i)));
here is the errod it displayes
Undefined function 'resample' for input arguments of type 'double'.
Error in untitled (line 24)
indices = resample(1:numFiles2, numToAdd, 'Replace', true);