If you want the errorbars to appear on the scattered points then change your plotting code to the following:
plot(yc_front,f_front,'b');
hold on
grid on
plot(yc_rear,f_rear,'r');
p(1) = scatter(yc_front,cp_front,'b','*');
errorbar(yc_front,cp_front,err*ones(size(cp_front)),'|b');
p(2) = scatter(yc_rear,cp_rear,'r','*');
errorbar(yc_rear,cp_rear,err*ones(size(cp_rear)),'|r');
xlabel("\it y/c");
ylabel("\it -C_P");
legend([p(1) p(2)],"Front","Rear");

