How can I integrate a function with matrices?
10 views (last 30 days)
Show older comments
I want to integrate the multivariate normal distribution. Here is my function:
mvNV_Blattstrke=@(x) ((1/sqrt(det(Kovarianzmatrix)*(2*pi)^T))*exp(-0.5*(x-mu).^k)*Inverse_Kovarianzmatrix*(x-mu));
Kovarianzmatrix, Inverse_Kovarianzmatrix and mu are 1x3 double matrices. T, k and the integration limits USG_Blattstrke and OSG_Blattstrke are 1x1 double variables. When I try to calculate the integration I get errors:
Integral_Blattstrke=integral(mvNV_Blattstrke,USG_Blattstrke,OSG_Blattstrke);
Matrix dimensions must agree.
Error in @(x)((1/sqrt(det(Kovarianzmatrix)*(2*pi)^3))*exp(-0.5*(x-mu).^k)*Inverse_Kovarianzmatrix*(x-mu))
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
0 Comments
Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!