f= @(x) cos(x+2)+x/2

fplot(f,[-2*pi,2*pi])