The function mfcc breaks the signal into frames for you, so you do not need to perform the frame processing yourself. Also, consider using an audioDatastore, as it will probably simplify your file handling logic.
Here is an example:
ads = audioDatastore(pwd,'Includesubfolders',true);
numFiles = numel(ads.Files);
avrgValues = zeros(numFiles,numCoeffs);
winLength = round(frameLength*fs);
coeffs = mfcc(x,fs,"Window",hann(winLength,'periodic'),'NumCoeffs',13,'OverlapLength',0,'Logenergy','ignore');
avrgValues(index,:) = mean(coeffs);