% Jon Newman

%% file id
fids = { 
    'J:/newmonster/2012_07_02_Xeko-1-minute-clamps/2012_07_02_Xeko-20709_one-min-clamp_07.mat';
    'J:/newmonster/2012_10_11-Herb-I5387-1-minute-clamps/2012_10_11_Herb-I5387_one-min-clamp_02.mat';
    'J:/newmonster/2012_10_22_Herb-I5386-1-minute-clamps/2012_10_22_Herb-I5386_one-min-clamp_10.mat'
    };


col = [[ 0 0 0];
    [0 100 255];
    [220 0 0]]/255;
sym1 = {'o','^','s'};

close all
figure('units','centimeter','position',[0 0 12 6]);
ax1 = axes('units','centimeter','position',[1.5 1 4 4]);
hold on;
set(gca,'TickDir','out','TickLength',[0.025 0.025]);
plot([0 12],[0 12],'k:')
axis([0 12 0 12])
xlabel('Target Rate')
ylabel('Acheived Rate')
ax2 = axes('units','centimeter','position',[7 1 4 4]);
hold on;
set(gca,'TickDir','out','TickLength',[0.025 0.025])
axis([0 12 0 1])
xlabel('Target Rate')
ylabel('u_1 and u_2')

for f = 1:length(fids)
    
    fid = fids{f};
    load(fid);
    
    %% Tracking
    plot(ax1,avg_perf.steps,avg_perf.ufr,'Color',col(f,:),'Marker',sym1{f})
    
    %% Control Signal
    plot(ax2,avg_perf.steps,avg_perf.uctl1,'Color',col(f,:),'LineStyle','-')
    plot(ax2,avg_perf.steps,avg_perf.uctl2,'Color',col(f,:),'LineStyle',':')
    
    
end

% export_fig -pdf -transparent 1-minute-clamp_temporal-avg-summary.pdf
