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: FUNCTION INTEGRATION WITH RANDOM NUMBER
Replies: 2   Last Post: Apr 3, 2014 12:38 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
george veropoulos

Posts: 45
Registered: 6/26/10
Re: FUNCTION INTEGRATION WITH RANDOM NUMBER
Posted: Apr 3, 2014 12:38 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"george veropoulos" <veropgr@yahoo.gr> wrote in message <lhj9do$ka6$1@newscl01ah.mathworks.com>...
> Dear friends
>
> i have a function F(x, E0, theta)
> E0 , theta are random number , i use the random function
>
>
> E0=random('unif',0,E0max,[1,10000]);
> thetae=random('unif',0,2*pi,[1,10000]);
>
> I want to integrate the f over x and make h histogram
> but i have problem with dimension
>
> i use the code
>
> E0=random('unif',0,E0max,[1,10000]);
>
> thetae=random('unif',0,2*pi,[1,10000]);
> %sources terms
> f1=@(x)F(r,E0,thetae);
> Es=integral(f1,0,s)
>
> the matllab give the error
>
> Error using .*
> Matrix dimensions must agree.
> in F


tnank you Lord
i find a solution
the integral function of matlab have a flag
ArrayValued',true indicates that the integrand is an array-valued function.
this work.....



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.