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: initializePlotting.m
    path of file: ./repos/p2d-model/two_term_approximation_model
    
    the code of the file until where you have to start completion: % function [ap_plt,an_plt,cp_plt,cs_plt,cn_plt,jp_plt,jn_plt,Phip_plt,Phin_plt,Ta_plt,Tp_plt,Ts_plt,Tn_plt,Tz_plt,vol_plt]=initializePlotting(U,Na,Np,Ns,Nn,Nz,x_le,x_0,x_p,x_s,x_n,x_re,numsteps)
function [ap_plt,an_plt,cp_plt,cs_plt,cn_plt,jp_plt,jn_plt,Phip_plt,Phin_plt,Ta_plt,T_avg,Tz_plt,vol_plt]=initializePlotting(U,Na,Np,Ns,Nn,Nz,x_le,x_0,x_p,x_s,x_n,x_re,numsteps)
    % indices for convenience
    [id_cs,id_cn,id_ap,id_an,~,~,id_jp,id_jn,id_Phip,id_Phin,~,~,~,id_Ta,id_Tp,id_Ts,id_Tn,id_Tz]=indices(Na,Np,Ns,Nn);

    % variables
    cp=U(2:Np+1);
    cs=U(id_cs+2:id_cs+Ns+1); 
    cn=U(id_cn+2:id_cn+Nn+1); 
    ap=U(id_ap+1:id_ap+Np); 
    an=U(id_an+1:id_an+Nn); 
    
    Phip=U(id_Phip+1:id_Phip+Np); 
    Phin=U(id_Phin+1:id_Phin+Nn);
    jp=U(id_jp+1:id_jp+Np);
    jn=U(id_jn+1:id_jn+Nn);
    
    Ta=U(id_Ta+2:id_Ta+Na+1);
    Tp=U(id_Tp+2:id_Tp+Np+1);
    Ts=U(id_Ts+2:id_Ts+Ns+1);
    Tn=U(id_Tn+2:id_Tn+Nn+1);
    Tz=U(id_Tz+2:id_Tz+Nz+1);
    
    % spatial discretization
    xa=linspace(x_le,x_0,Na)
    
function [ap_plt,an_plt,cp_plt,cs_plt,cn_plt,jp_plt,jn_plt,Phip_plt,Phin_plt,Ta_plt,Tp_plt,Ts_plt,Tn_plt,Tz_plt,vol_plt]=initializePlotting(U,Na,Np,Ns,Nn,Nz,x_le,x_0,x_p,x_s,x_n,x_re,numsteps)
function [ap_plt,an_plt,cp_plt,cs_plt,cn_plt,jp_plt,jn_plt,Phip_plt,Phin_plt,Ta_plt,T_avg,Tz_plt,vol_plt]=initializePlotting(U,Na,Np,Ns,Nn,Nz,x_le,x_0,x_p,x_s,x_n,x_re,numsteps)
    % indices for convenience
    [id_cs,id_cn,id_ap,id_an,~,~,id_jp,id_jn,id_Phip,id_Phin,~,~,~,id_Ta,id_Tp,id_Ts,id_Tn,id_Tz]=indices(Na,Np,Ns,Nn);

    % variables
    cp=U(2:Np+1);
    cs=U(id_cs+2:id_cs+Ns+1); 
    cn=U(id_cn+2:id_cn+Nn+1); 
    ap=U(id_ap+1:id_ap+Np); 
    an=U(id_an+1:id_an+Nn); 
    
    Phip=U(id_Phip+1:id_Phip+Np); 
    Phin=U(id_Phin+1:id_Phin+Nn);
    jp=U(id_jp+1:id_jp+Np);
    jn=U(id_jn+1:id_jn+Nn);
    
    Ta=U(id_Ta+2:id_Ta+Na+1);
    Tp=U(id_Tp+2:id_Tp+Np+1);
    Ts=U(id_Ts+2:id_Ts+Ns+1);
    Tn=U(id_Tn+2:id_Tn+Nn+1);
    Tz=U(id_Tz+2:id_Tz+Nz+1);
    
    % spatial discretization
    xa=linspace(x_le,x_0,Na);
    xp=linspace(x_0,x_p,Np);
    xs=linspace(x_p,x_s,Ns);
    xn=linspace(x_s,x_n,Nn);
    xz=linspace(x_n,x_re,Nz);

    figure('units','normalized','outerposition',[0 0 1 1])
    
    subplot(3,4,[3,4]);
    yyaxis left
    ap_plt=scatter(xp,ap,100,'.','b');
    hold on
    an_plt=scatter(xn,an,20,'+','g');
    hold off
    ylabel('Concentration');
    ylim([0 50000]);
    yyaxis right
    cp_plt=scatter(xp,cp,10,'*','y');
    hold on
    cs_plt=scatter(xs,cs,10,'*','m');
    cn_plt=scatter(xn,cn,10,'*','c');
    hold off
    ylabel('Concentration');
    xlim([x_0 x_n]);
    ylim([0 2000]);
    legend