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: CatStr.m
    path of file: ./repos/d4m/matlab_src
    
    the code of the file until where you have to start completion: function s12 = CatStr(s1,sep,s2)
%CatStr: Concatenates two string lists with a separator; inverse of StrSplit.
%String array user function.
%  Usage:
%    s12 = CatStr(s1,sep,s2)
%  Inputs:
%    s1 = string list of length 1 or n
%    sep = single character separator

    
function s12 = CatStr(s1,sep,s2)
%CatStr: Concatenates two string lists with a separator; inverse of StrSplit.
%String array user function.
%  Usage:
%    s12 = CatStr(s1,sep,s2)
%  Inputs:
%    s1 = string list of length 1 or n
%    sep = single character separator
%    s2 = string list of length 1 or n
%  Outputs:
%    s12 = string by string concatenation of s1, sep, and s2.
%  Example:
%    s12 = CatStr('a,b,c,','|','1,2,3,')


  % Replicate 'scalar' strings.
  Ns1 = NumStr(s1);  Ns2 = NumStr(s2);
  if ((Ns1 == 1) && (Ns2 > 1))
    s1 = repmat(s1,1,Ns2);
  end