Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 george veropoulos Posts: 45 Registered: 6/26/10
Re: FUNCTION INTEGRATION WITH RANDOM NUMBER
Posted: Apr 3, 2014 12:38 PM

"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.....

Date Subject Author
4/3/14 george veropoulos
4/3/14 Steven Lord
4/3/14 george veropoulos