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: clipLineRect.m
    path of file: ./repos/matGeom/matGeom/deprecated/geom2d
    
    the code of the file until where you have to start completion: function edge = clipLineRect(line, rect)
%CLIPLINERECT clip a line with a polygon.
%
%   EDGE = clipLineRect(LINE, RECT);
%   LINE: line in the form [x0 y0 dx dy]
%   RECT: a rectangle in the form [xr yr wr hr] (xr and yr: coordinate of
%   first point, wr and hr are width and height of rectangle)
%   
%   Deprecated: use function clipLine instead

% ------
% Author: David Legland 
% e-mail: david.legland@inrae.fr
% Created: 2006-07-24
% Copyright 2006 INRA - Cepia Software Platform

if size(line, 1)==1
    line = repmat(line, size(rect, 1), 1);

    
function edge = clipLineRect(line, rect)
%CLIPLINERECT clip a line with a polygon.
%
%   EDGE = clipLineRect(LINE, RECT);
%   LINE: line in the form [x0 y0 dx dy]
%   RECT: a rectangle in the form [xr yr wr hr] (xr and yr: coordinate of
%   first point, wr and hr are width and height of rectangle)
%   
%   Deprecated: use function clipLine instead

% ------
% Author: David Legland 
% e-mail: david.legland@inrae.fr
% Created: 2006-07-24
% Copyright 2006 INRA - Cepia Software Platform

if size(line, 1)==1
    line = repmat(line, size(rect, 1), 1);
elseif size(rect, 1)==1
    rect = repmat(rect, size(line, 1), 1);
elseif size(line, 1) ~= size(rect, 1)
    error('bad sizes for input');
end