How to integrate between a defined and an undefined limit

1 Ansicht (letzte 30 Tage)
Trond Oesten
Trond Oesten am 16 Mär. 2015
Bearbeitet: Trond Oesten am 16 Mär. 2015
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);

Antworten (1)

Torsten
Torsten am 16 Mär. 2015
syms x xend
a=int(x+5*x^2,0,xend);
Best wishes
Torsten.
  1 Kommentar
Trond Oesten
Trond Oesten am 16 Mär. 2015
Bearbeitet: Trond Oesten am 16 Mär. 2015
Sorry. I was not clear enough in my question. I have updated my question above

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by