Integration of a function from R^1 to R^n

5 views (last 30 days)
I have calculate the integral of a function.
This is a simple task: The function quad works fine for function from R^1 to R^1, and quad2 for R^2 to R^1 functions.
however, a way to calculate a simple R^1 to R^n functions does not exist! To be clear, i mean domain R^1 and range R^n, like a curve, for example.
I will appreciate any help!!!

Accepted Answer

Mike Hosea
Mike Hosea on 11 Apr 2012
The integral of a vector-valued function is vector-valued. You simply integrate each component. This can be done with QUADV or with INTEGRAL (new function in R2012a) using the 'ArrayValued' option set to true.
>> F = @(x)[x,sin(x),tan(x),log(x),exp(x)]
F =
@(x)[x,sin(x),tan(x),log(x),exp(x)]
>> integral(F,0,1,'ArrayValued',true)
ans =
0.5000 0.4597 0.6156 -1.0000 1.7183
>> quadv(F,0,1)
ans =
0.5000 0.4597 0.6156 -1.0000 1.7183
Did you want to calculate arc length or something else instead? -- Mike
  1 Comment
Luciano Raso
Luciano Raso on 12 Apr 2012
Hi Mike!
thanks a lot for your answer. I do not why i haven't seen it! Thanks!
Luciano

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!