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: imono.m
    path of file: ./repos/machinevision-toolbox-matlab
    
    the code of the file until where you have to start completion: %IMONO Convert color image to monochrome
%
% OUT = IMONO(IM, OPTIONS) is a greyscale equivalent to the color image IM.
%
% Options::
% 'r601'       ITU recommendation 601 (default)
% 'r709'       ITU recommendation 709
% 'value'      HSV value component
%
% Notes::
% - This function returns a greyscale image whether passed a color or a
%   greyscale image.  If a greyscale image is passed it is simply returned.
% - Can convert a color image sequence (HxWx3xN) to a monochrome
%   sequence (HxWxN).
%
% See also COLORIZE, ICOLOR, 
    
function returns a greyscale image whether passed a color or a
%   greyscale image.  If a greyscale image is passed it is simply returned.
% - Can convert a color image sequence (HxWx3xN) to a monochrome
%   sequence (HxWxN).
%
% See also COLORIZE, ICOLOR, COLORSPACE.



% Copyright (C) 1993-2011, by Peter I. Corke
%
% This file is part of The Machine Vision Toolbox for Matlab (MVTB).
% 
% MVTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
% 
% MVTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU Lesser General Public License for more details.
% 
% You should have received a copy of the GNU Leser General Public License
% along with MVTB.  If not, see <http://www.gnu.org/licenses/>.
function out = imono(im, opt)

    % WxH is mono
    % WxHx3 is color
    % WxHxN is mono sequence
    % WxHx3xN is color sequence
    if ~iscolor(im)
        % image is already monochrome
        out = im;
        return;
    end