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: CreateVectorFromParams.m
    path of file: ./repos/VFIToolkit-matlab/SubCodes/ParameterStructure
    
    the code of the file until where you have to start completion: function VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames,index1,index2)
%
% VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames)
% VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames,index1)
% VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames,index1,index2)
%
% CreateVectorFromParams looks in structure called 'Parameters' and 
% then creates a row vector containing the values of it's fields that

    
function VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames,index1,index2)
%
% VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames)
% VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames,index1)
% VectorOfParamValues=CreateVectorFromParams(Parameters,ParamNames,index1,index2)
%
% CreateVectorFromParams looks in structure called 'Parameters' and 
% then creates a row vector containing the values of it's fields that
% correspond to those field names in ParamNames (and in the order
% given by CalibParamNames)
%
% Some parameters are stored in the Parameters structure as vectors or
% matrices (eg., because the parameter values depend