i successfull to display them in gui with sorting from similiar images to unsimiliar images..but its overwrite left area in GUI looks like this

this is my code
% Retrieval
k=1;
ThCM=70; %threshold perbandingan citra
for j=1:ukuranbaris
    Sum = sum(abs(num(j,:)-databin));
    if Sum < ThCM
       Dist(k)= Sum;
       k=k+1;
       fileNm(k) = {raw{j+1,28}};
    end
end
Sum
Dist
% fileNm{1}
% fileNm{2}
% fileNm{3}
% fileNm{4}
%sorting for most similiar images to unsimiliar images 
[ImShr,Inx] = sort(Dist,'ascend');
pnf = size(Dist')
%program untuk menampilkan citra secara looping pada figure baru
% for k = 2 : pnf
%   thisFileName = fileNm{k}; 
%    ImgFile2 = imread(thisFileName);
%   %display the image
%   axes(handles.axes2)     %the current axes should be set to axes1
%  imagesc(ImgFile2);       %displays the data in array C as an image that uses the full range of colors in the colormap
%  %clear axes scale
%  subplot(3,3,k),imshow(ImgFile2);
%   hold on;
%  axis off
%   caption = sprintf('File %d of %d : "%s"', k, numel(fileNm), thisFileName)
%   title(caption, 'FontSize', 5);
%   drawnow;
%   
% end
ImShr
Inx
% BIKIN WINDOW BARU
for k = 1 : pnf(1,1)
  thisFileName = fileNm{Inx(k)+1}; 
%   figure(1), subplot(3,4,k),imshow(thisFileName);
subplot(3,4,k+1),imshow(thisFileName);
%       subplot(3, 4, 2);
%         imshow(fileNm{2}); %gambar ke 2
%       subplot(3, 4, 3);
%         imshow(fileNm{3}); %gambar ke 3
%       subplot(3, 4, 4);
%         imshow(fileNm{4}); %gambar ke 4
%       subplot(3, 4, 6);
%         imshow(fileNm{5}); %gambar ke 5
%       subplot(3, 4, 7);
%         imshow(fileNm{6}); %gambar ke 6
%       subplot(3, 4, 8);
%         imshow(fileNm{7}); %gambar ke 7
%         subplot(3, 4, 10);
%         imshow(fileNm{8}); %gambar ke 8
%       subplot(3, 4, 11);
%         imshow(fileNm{9}); %gambar ke 9
%       subplot(3, 4, 12);
%         imshow(fileNm{10}); %gambar ke 10
%   caption = sprintf('File %d of %d : "%s"', k, numel(fileNm), thisFileName);
%   title(caption, 'FontSize', 5);
%hold on
  drawnow;
end
pause(15)
close all;







