
Re: Error : Inner matrix dimensions must agree When computing the three dimensional integral.
Posted:
Jun 24, 2013 11:14 AM


"yolanda " <shuyiyan2012@hotmail.com> wrote in message news:kpvbmd$egs$1@newscl01ah.mathworks.com... > Hi, > > I do appreciate your reply! > You are right. I also checked the triplequad function detailedly > yesterday. And as I defined, z should be a vector and then I can use the > function triplequad. > > So as you said, the two matrixs don't work. Then how should I define the f > function? > The exponentional part of the f function is just the part of the three > dimension > joint Gaussian distributation as following: > > exp( > ([(xm1),(ym2),(zm3)]*(cov1)*[(xm1);(ym2);(zm3)])./(2) )./((sqrt(2*pi)).^3.*(sqrt(det(cov)))) > It has three matrixs operation. So how should I define?
If you need/want this to be written as an anonymous function, try using ARRAYFUN to operate on each element of z in turn, like:
arrayfun(@(t) [1 t]*[1 2; 3 4]*[t; 1], 1:10)
 Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com

