Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: numerical integration
Replies: 1   Last Post: Mar 20, 2014 4:12 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mike Hosea

Posts: 3
Registered: 3/19/14
Re: numerical integration
Posted: Mar 20, 2014 4:12 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Milad <hs597823@dal.ca> wrote in message <bfKdnTElz7ow15_OnZ2dnUVZ_qSdnZ2d@giganews.com>...
> Suppose you want to integrate a function from (0,n), where n is matrix 2*2 and you have a function of x example: y=sin(x),
> what is the command in matlab to compute the integral for each variable separately.
> to end up with results like matrix:[y1,1 y1,2; y2,1,y2,2]
> thanks
>


>> f = @(n)integral(@sin,0,n)
f =
@(n)integral(@sin,0,n)
>> arrayfun(f,[1,2;3,4])
ans =
0.459697694131860 1.416146836547142
1.989992496600445 1.653643620863612


Date Subject Author
2/17/14
Read numerical integration
Milad
3/20/14
Read Re: numerical integration
Mike Hosea

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.