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: cubicBezierToPolyline.m
    path of file: ./repos/matGeom/matGeom/geom2d
    
    the code of the file until where you have to start completion: function varargout = cubicBezierToPolyline(points, varargin)
%CUBICBEZIERTOPOLYLINE Compute equivalent polyline from bezier curve control.
%
%   POLY = cubicBezierToPolyline(POINTS, N)
%   Creates a polyline with N edges from the coordinates of the 4 control
%   points stored in POINTS. 
%   POINTS is either a 4-by-2 array (vertical concatenation of point
%   coordinates), or a 1-by-8 array (horizontal concatenation of point
%   coordinates). 
%   The result is a (N-1)-by-2 array.

    
function varargout = cubicBezierToPolyline(points, varargin)
%CUBICBEZIERTOPOLYLINE Compute equivalent polyline from bezier curve control.
%
%   POLY = cubicBezierToPolyline(POINTS, N)
%   Creates a polyline with N edges from the coordinates of the 4 control
%   points stored in POINTS. 
%   POINTS is either a 4-by-2 array (vertical concatenation of point
%   coordinates), or a 1-by-8 array (horizontal concatenation of point
%   coordinates). 
%   The result is a (N-1)-by-2 array.
%
%   POLY = cubicBezierToPolyline(POINTS)
%   Assumes N = 64 edges as default.
%
%   [X Y] = cubicBezierToPolyline(...)
%   Returns the result in two separate arrays for X and Y coordinates.
%
%
%   Example
%     poly = cubicBezierToPolyline([0 0;5 10;10 5;10 0], 100);
%     drawPolyline(poly, 'linewidth', 2, 'color', 'g');
%
%   See also 
%     drawBezierCurve, drawPolyline
%

% ------
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2011-10-06, using Matlab 7.9.0.529 (R2009b)
% Copyright 2011-2023 INRA - Cepia Software Platform

% default number of discretization steps
N = 64;

% check if discretization step is specified
if ~isempty(varargin)
    var = varargin{1};
    if length(var) == 1 && isnumeric(var)
        N = round(var);
    end