You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: horizontal_flip.m
    path of file: ./repos/Digital-Image-Processing/Color Image Processing
    
    the code of the file until where you have to start completion: function resimg = horizontal_flip()
  
  % replace `PATH_TO_IMAGE` with actual image file
  impath = 'PATH_TO_IMAGE';
  
  img = imread(impath);
  
  % fetch the dimension of image
  % n denotes number of color channel / planes (i.e. 3 for RGB image)
  % nr & nc defines number of rows & columns respectively in each planes
  [nr,nc,n] = size(img);
  

    
function resimg = horizontal_flip()
  
  % replace `PATH_TO_IMAGE` with actual image file
  impath = 'PATH_TO_IMAGE';
  
  img = imread(impath);
  
  % fetch the dimension of image
  % n denotes number of color channel / planes (i.e. 3 for RGB image)
  % nr & nc defines number of rows & columns respectively in each planes
  [nr,nc,n] = size(img);
  
  % logic for flipping the image
  for i = 1:nr
        
    resimg(i,1:nc,1:n) = img(nr-i+1,1:nc,1:n);
          
  end