MATLAB: Integration help (quad)

integrationquad

New to Matlab and stuck trying to integrate trigXtrig function.
Here's what I've been doing:
function y=rfun(theta)
y=(cos(theta).*sin(theta).);
end
EDU>> q=quad('rfun',0,0.644)
But I get this error:
Error in ==> quad at 77
y = f(x, varargin{:});

Best Answer

Why not use an anonymous function instead?
>> y = @(th) cos(th).*sin(th); % The function to integrate...
>> q = quad(y,0,0.644) % Also, quadl(y,0,0.644)
Related Question