t = linspace(-2,2);

f = 1/3*(t.^3+1);
plot(t,f);
hold on;
plot(t,t,'r');
grid on;
ylim([-2 2]);