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: writevmdvector.m
    path of file: ./repos/mdtoolbox/mdtoolbox
    
    the code of the file until where you have to start completion: function rc = writevmdvector(basename, crd, pcs, scale, resolution, radius)
%% writevmdvector
% output tcl scripts for drawing vectors in VMD
% 
% writevmdvector(basename, crd, pcs, scale, resolution, radius)
% 

    
function rc = writevmdvector(basename, crd, pcs, scale, resolution, radius)
%% writevmdvector
% output tcl scripts for drawing vectors in VMD
% 
% writevmdvector(basename, crd, pcs, scale, resolution, radius)
% 
% >> load calc_pca.mat pmode ref b_index_ca;
% >> ca_ref = ref(:, to3(b_index_ca));
% >> writevmdvector('positive', ca_ref, pmode(:,1:10));
% >> writevmdvector('negative', ca_ref, -pmode(:,1:10));
%

%% initialization
if ~exist('scale', 'var') || ~exist('resolution', 'var') || ~exist('radius', 'var')
% for bpti ca
%  scale = 15.0;
%  resolution = 100;
%  radius = 0.08;

% for trap
  scale = 170.0;
  resolution = 100;
  radius = 0.2;

% for alanine
%  scale = 3.0;
%  resolution = 100;
%  radius = 0.1;

% for bpti all-atom
%  scale = 40.0;
%  resolution = 100;
%  radius = 0.06;
end