2*quad(@(t)exp(-t.^2),0,-2)/sqrt(pi)

2*quad(@(t)exp(-t.^2),0,-2)/sqrt(pi)

x = linspace(-2,2,200);
val = zeros(length(x),1);
for i = 1:length(x)
    val(i) = 2*quad(@(t)exp(-t.^2),0,x(i))/sqrt(pi);
end
plot(x,val')
