How find the integral of a function from 0 to a equal to a certain number

Okay, so for a program I'm writing for a class I need to find the area under a curve from 0 to a number (say 4) and then find K so that the area under this curve from 4 to K is equal to that first area. Is that possible to do with MatLab? Thanks for any help you can give me.

 Accepted Answer

Hi, Do you want to do this integration symbolically, or numerically?
See the help for quad (numerical) and sym/int
>>doc quad
>>doc sym/int

4 Comments

Numerically I suppose. I mean I need to find actual numbers, not equations.
Brian will also need fzero() or equivalent for the numeric side, and solve() or equivalent for the symbolic side (though there is not certain to _be_ an analytic solution for arbitrary functions.)
Think about
int(sym('x^2'),0,4)
% and
syms k
int(sym('x^2'),4,k)
Then when would these be equal and consider Walter's hint.
Thanks a lot! I appreciate the help

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!