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: img2hist.m
    path of file: ./repos/automaticanalysis/extrafunctions
    
    the code of the file until where you have to start completion: % This function loads an image (or matrix), and plots a histogram from it
%
% FORMAT function h = img2hist(fileName, [bins], [name], [prcOutlier])
%   - h:            handle to the 
    
function loads an image (or matrix), and plots a histogram from it
%
% FORMAT function h = img2hist(fileName, [bins], [name], [prcOutlier])
%   - h:            handle to the plot
%
%   - fileName:     
%       filename of the image (vcat strings for multiple images) or
%       cell of matrices
%   - bins:         number of bins
%   - name:         title for plots (vcat strings for multiple images)
%   - prcOutlier:   percentile threshold for detecting outliers

function h = img2hist(fileName, bins, name, prcOutlier)

if ischar(fileName)
    fileName = strvcat2cell(fileName);
end