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: PlaceCPS.m
    path of file: ./repos/MatlabGDSPhotonicsToolbox/Functions/Component
    
    the code of the file until where you have to start completion: function [structgds, infoOut, infoIn, infoInBias, infoOutBias, WGw, WGBias]= PlaceCPS(structgds, info, len, CPSinfo, varargin)
%PlaceCPS places a coplanar strip (CPS) in a gds structure
%Author : Alexandre D. Simard                     Creation date: 11/11/2014
%
%     This function receives an input GDS structure and the parameters for one or many
%     rectangles to create and place at positions and orientations determined by the info
%     variable. It then updates info to the output positions.
%
%     See also CPS, PlaceRect

    
function [structgds, infoOut, infoIn, infoInBias, infoOutBias, WGw, WGBias]= PlaceCPS(structgds, info, len, CPSinfo, varargin)
%PlaceCPS places a coplanar strip (CPS) in a gds structure
%Author : Alexandre D. Simard                     Creation date: 11/11/2014
%
%     This function receives an input GDS structure and the parameters for one or many
%     rectangles to create and place at positions and orientations determined by the info
%     variable. It then updates info to the output positions.
%
%     See also CPS, PlaceRect


%% Arguments validation
rows = size(info.pos, 1);
[CPSinfo] = NumberOfRows(rows, CPSinfo);
outputBias = false;

%% Place CPS
NroutingWG = 1;
Nbias = 1;
for row = 1:rows
  infoloc = SplitInfo(info,row);
  
  for ii = 1:length(CPSinfo(row).layer)
    
    infoii = infoloc;
    
    infoii.ori = infoii.ori + 90*sign(CPSinfo(row).shift(ii));
    [~, infoii] = PlaceRect(structgds, infoii, abs(CPSinfo(row).shift(ii)), 1, 1, 1);
    infoii.ori = infoii.ori - 90*sign(CPSinfo(row).shift(ii));
    
    [structgds, infoiiout] = PlaceRect(structgds,infoii, len, CPSinfo(row).w(ii), CPSinfo(row).layer(ii), CPSinfo(row).dtype(ii));
    
    % find info for routing
    if any(CPSinfo(row).layer(ii) == CPSinfo(row).routinglayer) &&  any(CPSinfo(row).dtype(ii) == CPSinfo(row).routingdtype)
      infoOut{NroutingWG} = infoiiout;
      infoIn{NroutingWG} = infoii;
      WGw(NroutingWG,1) = CPSinfo(row).w(ii);
      NroutingWG = NroutingWG + 1;
    end