How to integrate between a defined and an undefined limit

1 回表示 (過去 30 日間)
Trond Oesten
Trond Oesten 2015 年 3 月 16 日
編集済み: Trond Oesten 2015 年 3 月 16 日
Hi,
I have performed an double integration of a function containing 3 variables. The function is now only dependent on 1 varaible. Is there an easy way I can integrate the function for this last variable to, but I want it to go between a defined value (lets say 0) and an undefined variable (a). Is there an easy way to do this? or should this be performed as a tripple integral right away? Thanks!
My script:
clc; clear all; close all;
C = [23.875 15.75281; 15.75281 93.9842];
mu_U = 1788.2058;
mu_K = 70.8489;
sigma_U = sqrt(C(1,1));
sigma_k = sqrt(C(2,2));
ubot = mu_U-4*sigma_U;
utop = mu_U+4*sigma_U;
kbot = mu_K-4*sigma_k;
ktop = mu_K+4*sigma_k;
xbot = 0;
xtop = @(a) a;
mu = [mu_U;mu_K];
% Double integral
fun = @(x,u,k) wblpdf(x,u,k).*reshape(mvnpdf([u(:),k(:)],mu(:).',C),size(u));
qfun_scalar = @(x)integral2(@(u,k)fun(x,u,k),ubot,utop,kbot,ktop);
uncpdf = @(x)arrayfun(qfun_scalar,x);
% Tripple integral
qfun_scalar2 = @(a)integral3(@(x,u,k)fun(x,u,k),xbot,xtop,ubot,utop,kbot,ktop);
unccdf = @(a)arrayfun(qfun_scalar2,a);

回答 (1 件)

Torsten
Torsten 2015 年 3 月 16 日
syms x xend
a=int(x+5*x^2,0,xend);
Best wishes
Torsten.
  1 件のコメント
Trond Oesten
Trond Oesten 2015 年 3 月 16 日
編集済み: Trond Oesten 2015 年 3 月 16 日
Sorry. I was not clear enough in my question. I have updated my question above

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by