The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 <> wrote in message <>...
> 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 =
>> arrayfun(f,[1,2;3,4])
ans =
0.459697694131860 1.416146836547142
1.989992496600445 1.653643620863612

Date Subject Author
Read numerical integration
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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.