Matlab - Interpreting rate of convergence from polyfit()

314 Views Asked by At

I was not sure if this question was more appropriate for math.stackexchange or stackoverflow so please let me know and I will migrate it accordingly.

I want to determine the rate of convergence for the absolute error of the composite trapezoidal rule when applied to the function sin(x/2).

Using a loglog plot of the error vs. the number of points shows a negative linear relationship. I used polyfit(log10(points),log10(error)) and get [-2,-2.213].

At this point I am unsure how to interpret this. Do I just state the my rate of convergence is the slope -2?