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: beamRefConfRotMat.m
    path of file: ./repos/ONSAS/src/elements/frame/auxiliar
    
    the code of the file until where you have to start completion: % Copyright 2023, ONSAS Authors (see documentation)
%
% This file is part of ONSAS.
%
% ONSAS is free software: you can re
    
function [ Ro, lengthElem ] = beamRefConfRotMat( x ) ;

  assert( iscolumn(x), 'coordinates must be in a column vector.')

  lengthElem = norm(x) ;

  exL = x / lengthElem ;

  eyG = [0 1 0]' ;    ezG = [0 0 1]' ;

  % Vector normal to beam in reference configuration
  if ( abs( exL(1) ) > 1e-8*lengthElem ) || ( abs( exL(2) ) > 1e-8*lengthElem ) ; % if exL it is not ezG
    aux = cross( ezG, exL ) ;
    eyL = aux / norm( aux ) ;
  else
    eyL = eyG ;
  end