function capillary_glucose_analyses(left,right)
%input vectors must be same length

close all

%A:  single_subject_glucose_over_weeks
figure, hold on
set(gca,'FontName','MyriadPro')

lgreater=repmat(nan,1,length(left));
rgreater=lgreater;
eq=lgreater;

for day=1:length(left)
    cv=std([left(day) right(day)])/mean([left(day) right(day)]);
    if left(day)>right(day)
        lgreater(day)=cv;
    elseif left(day)<right(day)
        rgreater(day)=cv;
    else
        eq(day)=cv;
    end
end

plot(lgreater,'o','markeredgecolor','k','markerfacecolor','w','markersize',10,'linewidth',1)
plot(rgreater,'s','markeredgecolor','k','markerfacecolor','w','markersize',10,'linewidth',1)
plot(eq,'^','markeredgecolor','k','markerfacecolor','w','markersize',10,'linewidth',1)

xlabel('day')
ylabel('CV')
%legend('Left greater','Right greater','Equal')
%legend boxoff
ylim([-.005 .205])
set(gca,'ytick',[0 0.05 0.1 0.15 0.2])



%B: measure 1 v measure 2 for both within-hand and across-hands data sets 
%here 'left' and 'right' become dissociated from their original, linguistic meaning and have meaning only as two separate variables
figure, hold on
plot(left(:,1),left(:,2),'o','markeredgecolor','k','markerfacecolor','w','markersize',8)
plot(right(:,1),right(:,2),'o','markeredgecolor','k','markerfacecolor','w','markersize',8)
xlabel('Measure A')
ylabel('Measure B')
