It is very easy to pass arguments to the "anonymous" function. As I recall correctly, since Matlab 6 the "@" function is exactly doing what you want. Here is an example

y = c1; f1 = @(x) f(x,y);
int1 = adaptiveLobatto(f1,a,b);

x = c2; f2 = @(y) f(x,y);
int2 = adaptiveLobatto(f2,a,b);

This makes your code more clear than passing all the arguments to the "anonymous" function.

x=[1,1,1,1,1,1,1,1,1,1,1,1]
z=adaptivelobatto(@(y)cos(x*y),0,0.5*pi,10e-6)
i get an error
z=quadv(@(y)cos(x*y),0,0.5*pi) no error
how can i use the adaptivelobatto in this case

Hi Matthias,
I have tried to use your codes to improve the speed of my functions.
Though if I use the example from your codes:
Q = adaptiveSimpson(@(x) [-cos(50*x); sin(x)], 0, pi, 'tol', 1e-6)
I get the following error:
Undefined function 'adaptiveSimpson' for input arguments of type 'function_handle'.

Useful..but could have been better if the calculation based on groups or classes would have possible..for example, in a single column data (variables), you have several classes (categories), and then calculation on each categories would have achieved. If you do not understand, please refer "grpstats" function of MATLAB..Combination of these fucntions would give more flexibility may be...Anyway good function... :)