フィルターのクリア

how to integral2?

2 ビュー (過去 30 日間)
elham kreem
elham kreem 2018 年 3 月 16 日
コメント済み: elham kreem 2018 年 3 月 16 日
how can i integral a function which was written in matlab but there is wrong , i dont no where it is :
syms tau
syms y
f= @(y,tau)y*exp(-0.5.*y.^2/ tau)
expecty=integral2(f, -2,4,0,Inf,'auto')

採用された回答

Birdman
Birdman 2018 年 3 月 16 日
integral2 is defined for function handle, therefore you do not need symbolic variables:
f= @(y,tau)y.*exp(-0.5.*y.^2./ tau)
expecty=integral2(f, -2,4,0,Inf,'auto')
  6 件のコメント
Torsten
Torsten 2018 年 3 月 16 日
Neglecting numerical aspects like division by 0, your integral is +Inf.
Best wishes
Torsten.
elham kreem
elham kreem 2018 年 3 月 16 日
gentelmen , thanks for your answers , but there is something wrong?
because the result is not convincing .
if i integrate the function with syms y and tau , are the code right and the result?
syms tau
syms y
fun = @(y,tau) (1/tau) * y * exp((-0.5*y^2 / tau)
f1 = int(fun , y ,tau )
is this mean double integral , for y and tau?
the result is
exp(-y^2/(2*tau)) - exp(-tau/2)
is the result convincing?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by