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: arMergePlot.m
    path of file: ./repos/d2d/arFramework3/Advanced
    
    the code of the file until where you have to start completion: % arMergePlot(jm, index_name1, index_name2, label_name1, label_name2, new_condition_name)
% 
% Can be used to merge plots of two data sets.
% 
%   jm                  Model index
%   index_name1         Name of data 1
%   index_name2         Name of data 2
%   
    
function arMergePlot(jm, index_name1, index_name2, label_name1, label_name2, new_condition_name)

global ar

if(isnumeric(index_name1))
    index1 = index_name1;
else
    index_name1 = strrep(strrep(strrep(strrep(index_name1,'=','_'),'.',''),'-','_'),'/','_');
    index1 = -1;
    for jp = 1:length(ar.model(jm).plot)
        if(strcmp(ar.model(jm).plot(jp).name, index_name1) && index1==-1)
           index1 = jp;
        elseif(strcmp(ar.model(jm).plot(jp).name, index_name1) && index1~=-1)
            error('multiple matches for data set with name %s', index_name1);
        end