t = linspace(0,1);
y = 2*t.*(1-t);

plot(t,y);
hold on;
plot(t,t,'r');