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: psf.m
    path of file: ./repos/IRtools/Extra/prblur_tools/@psf
    
    the code of the file until where you have to start completion: function P = psf(varargin)
%
%  CONSTRUCTOR FUNCTION FOR PSF OBJECT
%
%  The psf class is based on a structure with two fields:
%    image - cell array containing the images of one or more
%            point spread functions.
%
%    center - cell array containing the centers of the individual
%             PSFs (that is, the locations of the point sources
%             which created the PSFs).
%
%  Calling Syntax:
%       P = psf
%       P = psf(psfObj)
%       P = psf(PSF)
%       P = psf(PSF, center)
%
%  where
%    * psfObj   is already a psf object
%    * PSF      can either be a double array containing a single PSF
%               image, or a cell array containing one or more PSF images.
%    * center   is either a double array of length two, or a cell array
%               containing the center(s) of the PSF(s).
%               If the center is not specified, we assume it's at or
%               near the location of the maximum entry of the PSF.
%

    
function P = psf(varargin)
%
%  CONSTRUCTOR FUNCTION FOR PSF OBJECT
%
%  The psf class is based on a structure with two fields:
%    image - cell array containing the images of one or more
%            point spread functions.
%
%    center - cell array containing the centers of the individual
%             PSFs (that is, the locations of the point sources
%             which created the PSFs).
%
%  Calling Syntax:
%       P = psf
%       P = psf(psfObj)
%       P = psf(PSF)
%       P = psf(PSF, center)
%
%  where
%    * psfObj   is already a psf object
%    * PSF      can either be a double array containing a single PSF
%               image, or a cell array containing one or more PSF images.
%    * center   is either a double array of length two, or a cell array
%               containing the center(s) of the PSF(s).
%               If the center is not specified, we assume it's at or
%               near the location of the maximum entry of the PSF.
%

%  J. Nagy 1/12/02

switch nargin
case 0
  % if no input arguments, create default object
  P.image = {};
  P.center = {};
  P = class(P, 'psf');
case 1
  % if single argument of class psf, return it
  if ( isa( varargin{1}, 'psf' ) )
    P = varargin{1};
  elseif ( isa (varargin{1}, 'double' ) )
    I = cell(1);
    I{1} = varargin{1};
    P.image = I;
    P.center = findCenter( P.image );
    P = class(P, 'psf');
  elseif ( isa (varargin{1}, 'cell' ) )
    P.image = varargin{1};
    P.center = findCenter( P.image );
    P = class(P, 'psf');
  else
    error('Incorrect argument type')
  end