%% Vector-Valued Function
% Create the vector-valued function f(x) = [\sin x, \: \sin 2x, \: \sin 3x, \: \sin 4x, \: \sin 5x] and integrate from x=0 to x=1. Specify 'ArrayValued',true to evaluate the integral of an array-valued or vector-valued function.

fun = @(x)sin((1:5)*x);
q = integral(fun,0,1,'ArrayValued',true)

% Copyright 2012 The MathWorks, Inc.