erf:
It is an Error function. Y = erf(X) is the error function for each element of X. X must be real. The error function is defined as:
erf(x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt.
Trapezoidal method:
Trapezoidal method is a popular method for numerical integration of various functions. This method is mainly applicable to estimate the area under a curve by splitting the entire area into a number of trapeziums of known area.
You are also creating a function handle , splitting the area under your function into finite trapezoids[4 in number] and then finding the cumulative area of all the trapezoids.
This way you can just find the area under each y and not the volume using this method. Hope this link would be helpful to you.