function short_term_dynamics_oct2007(case_numbers_and_trialcountmats,mpt,cpdata,critz_cell_array,rawmat_cell_array)
% called from command line

%case_numbers_and_trialcountmats=[case_numbers_and_trialcountmats [presentcase;livetrials_preinduc_specificwindow(end);trialcountmat_fullrange(1);trialcountmat_fullrange(2);...
%trialcountmat_specificcontinuouswindowrange(1);trialcountmat_specificcontinuouswindowrange(2);trialcountmat_specificdiscretewindowrange(1);trialcountmat_specificdiscretewindowrange(2)]];

successes=[1 3 5 7 8 9 10 11 12 15];
failures=[2 4 6 13 14];
succs_and_fails=[1 2 5 7 8 9 10 12 14 15 25 26 27 28 30];
clr=colors_for_stdp_expts(length(cpdata));
IPI_class1=[12.5 25 50];    %100 ms is omitted due to the variable behavior
IPI_class2=[150 200 400 800];

%first job:  check how the change points align with the postinduction stable baseline
%show that for most cases both cps are before the second time window
datz=[];
for expt=1:15
     lastpreinductrial=case_numbers_and_trialcountmats(5,expt);
    datz(expt,1)=cpdata(3,expt)+lastpreinductrial;  %translating the cp to the overall number of trials
    datz(expt,2)=cpdata(7,expt)+lastpreinductrial; %translating the cp to the overall number of trials
    crit=critz_cell_array{succs_and_fails(expt)};num_APs=size(crit,1);      %the cell arrays are numbered by 'presentcase' in analyze_across... (i.e., up to 30), so a reorientation is needed
    
    datz(expt,3)=size(crit,2)-(case_numbers_and_trialcountmats(8,expt)-1);  %the trial on which the postinduc stable window begins 
    datz(expt,4)=lastpreinductrial;
    
    IPIs=rawmat_cell_array{succs_and_fails(expt)}(1:2,:);
    if size(IPIs,2)~=size(crit,2),error('mismatch'),end
    if size(crit,1)==3,IPI_of_interest=1;elseif size(crit,1)==4,IPI_of_interest=2;end
    IPI_class_membership=class_membership_assigner(IPI_class1,IPI_class2,pscmat(IPI_of_interest,:));
    hd_val=size(crit,1)
    for pre_v_post=1:2
        for short_v_long=1:2
            figure(1),subplot(1,2,pre_v_post)
            if pre_v_post==1,trialschunk=[(cnt(2,expt)-(cnt(7,expt)-1)):cnt(2,expt)];else trialschunk=[(size(crit,2)-(case_numbers_and_trialcountmats(8,expt)-1)):size(crit,2)];end
            z=IPI_class_membership(trialschunk)
            hd(pre_v_post,short_v_long)=mean(array_of_charges
            
            
end
%rectangles_with_error_bars(datz,datz,datz,clr',0,{})

%then use the IPI data from the rawmat to show HD (charge of nth pulse depending whether n-1th IPI was long or short) before and after induc (discrete windows)

% %then show q50 v q_o for the 2007 cases, before and after, need 4 k-s tests

%then show q_o v q_a short v q_a long before and after (9 k-s tests)

% then quickly make an example with mean waveforms (show both short and long term in the example)

%then do the temporal stuff, example waveform, example divergence detection, scatterplot