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: convexification.m
    path of file: ./repos/matGeom/matGeom/polygons2d
    
    the code of the file until where you have to start completion: function co = convexification(varargin)
%CONVEXIFICATION Compute the convexification of a polygon.
%
%   CO = convexification(H)
%   Creates convexification from support function. Support function is
%   supposed to be uniformly distributed over [0 2pi].
%
%   CO = convexification(POLYGON)
%   Computes support function of the polygon, then the corresponding
%   convexification.
%
%   CO = convexification(POLYGON, N)

    
function co = convexification(varargin)
%CONVEXIFICATION Compute the convexification of a polygon.
%
%   CO = convexification(H)
%   Creates convexification from support function. Support function is
%   supposed to be uniformly distributed over [0 2pi].
%
%   CO = convexification(POLYGON)
%   Computes support function of the polygon, then the corresponding
%   convexification.
%
%   CO = convexification(POLYGON, N)
%   Uses N points for convexification computation. Note that the number of
%   points of CO can be lower than N.
%   
%   CAUTION: The result will be valid only for convex polygons.
%
%   See also 
%   polygons2d, supportFunction 

% ------
% Author: David Legland 
% E-mail: david.legland@inrae.fr
% Created: 2005-01-12
% Copyright 2005-2023 INRA - Cepia Software Platform

if ~isempty(varargin)>0
    var = varargin{1};
    if size(var, 2)==1
        h = var;
    else
        poly = var;
        N = 128;
        if length(varargin)>1
            N = varargin{2};
        end