Integration: what am I doing wrong?

2 ビュー (過去 30 日間)
Alex Stead
Alex Stead 2017 年 5 月 12 日
コメント済み: Alex Stead 2017 年 5 月 12 日
Hi all. I am (very) new to Matlab, so apologies if this is obvious:
I am trying to get to grips with symbolic integration in Matlab. I've tried a few very simple examples, and they've worked. Then I decided to try using Matlab to find the convolution of a normal p.d.f. with a half-normal p.d.f. I know that there is a closed-form solution to this integral - it should give the p.d.f. of a skew-normal r.v. - but either Matlab cannot find it or (more likely) I am missing something here. Here is the code:
syms o p u real positive
syms a real
int(1/o*normpdf((a+u)/o)*2/p*normpdf(u/p),u)
Note that, to get the skew-normal p.d.f. I actually be asking for the definite integral over 0-inf, but for now I'm just trying to get out the indefinite integral.

回答 (1 件)

KSSV
KSSV 2017 年 5 月 12 日
syms o p u a real
k = int(1/o*normpdf((a+u)/o)*2/p*normpdf(u/p),u)
It is working fine....error is with positive variable name
  1 件のコメント
Alex Stead
Alex Stead 2017 年 5 月 12 日
Hi KSSV,
Thanks, but that code isn't working for me. I'm using version R2013a, and still getting the "Warning: Explicit integral could not be found." message.

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

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by