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: xyzv2rtpv.m
    path of file: ./repos/ott/+ott/+utils
    
    the code of the file until where you have to start completion: function [rv,thetav,phiv,r,theta,phi] = xyzv2rtpv(xv,yv,zv,x,y,z)
% XYZV2RTPV cartiesian to spherical vector field conversion
%
% [rv,thetav,phiv,r,theta,phi] = XYZV2RTPV(xv,yv,zv,x,y,z)
%
% [vec_sph,pos_sph] = XYZV2RTPV(vec_cart,pos_cart)
%
% See also rtpv2xyzv and xyz2rtp.

% This file is part of the optical tweezers toolbox.
% See LICENSE.md for information about using/distributing this file.

ott.warning('internal');


    
function [rv,thetav,phiv,r,theta,phi] = xyzv2rtpv(xv,yv,zv,x,y,z)
% XYZV2RTPV cartiesian to spherical vector field conversion
%
% [rv,thetav,phiv,r,theta,phi] = XYZV2RTPV(xv,yv,zv,x,y,z)
%
% [vec_sph,pos_sph] = XYZV2RTPV(vec_cart,pos_cart)
%
% See also rtpv2xyzv and xyz2rtp.

% This file is part of the optical tweezers toolbox.
% See LICENSE.md for information about using/distributing this file.

ott.warning('internal');

if nargin < 6
   x = yv(:,1);
   y = yv(:,2);
   z = yv(:,3);
   zv = xv(:,3);
   yv = xv(:,2);
   xv = xv(:,1);
end