Yes, I just find it curious that the other functions do not error on the same integrand despite having the same vector function requirements.
Peeking in quadgk I assume it's because of the transform that occurs on lines 235-236, that essentially redefines the function as a vector function whether it starts as one or not. maybe similar things happen in quadl. quad and quadv don't have the same requirement.
I bring this up because I was trying out some compatibility tests with integral2.
Matlab gives the same vector function error as quadcc for all of its vectorized quad functions (quadgk, quadl) and integral. similar for dblquad:
>> dblquad(@(x,y) x, 0,1,0,1) ans = 0.5000 >> dblquad(@(x,y) y, 0,1,0,1) Error using quad (line 70) The integrand function must return an output vector of the same length as the input vector.
but not for integral2: >> integral2(@(x,y) x, 0,1,0,1) ans = 0.5000 >> integral2(@(x,y) y, 0,1,0,1) ans = 0.5000
since we switched integral2 over to using quadcc, we get the same effort as dblquad >> integral2(@(x,y) x, 0,1,0,1) ans = 0.50000 >> integral2(@(x,y) y, 0,1,0,1) error: quadcc: integrand F must return a single, real-valued vector
just leave this under the category of 'undocumented matlab we aren't going to worry about'?