close all
clear all

V = 0:10;

DC_t = 100*(.5*[0:10]/10+.25);

DC_a = [18 24 30 37 43 49 55 62 68 74 80];

per_err = (DC_a-DC_t)./DC_t;

amp_err = (DC_a-25)*.4-(DC_t-25)*.4;

figure
subplot(3,1,1)
plot(V,DC_t,V,DC_a);
legend('Perfect','Measured','Location','NorthWest');
ylabel('Duty Cycle (%)');
subplot(3,1,2)
plot(V,per_err);
ylabel('Percent error');
xlabel('input voltage');
subplot(3,1,3)
plot(V,amp_err);
ylabel('Amp error');
xlabel('input voltage');