July 24th, 2013, 8:12 pm
Hi all,After searchin in the internet, we can use the function triplequad to compute a triple integral.However it's not working for the following example :>> S = [1 1/sqrt(2) 1/sqrt(3); 1/sqrt(2) 1 sqrt(2)/sqrt(3); 1/sqrt(3) sqrt(2/3) 1]>> F = @(x,y,z)exp([x y z]*inv(S)*transpose([x y z]));>> Q = triplequad(F,0,1,0,1,-1,1);??? Error using ==> mtimesInner matrix dimensions must agree.Error in ==> @(x,y,z)exp([x,y,z]*inv(S)*transpose([x,y,z]))Error in ==> quad at 77y = f(x, varargin{:});Error in ==> triplequad>innerintegral at 69 Q(i) = quadf(intfcn, xmin, xmax, tol, trace, y(i), z, varargin{:});Error in ==> dblquad>innerintegral at 80fcl = intfcn(xmin, y(1), varargin{:}); %evaluate only to get the class belowError in ==> quad at 77y = f(x, varargin{:});Error in ==> dblquad at 60Q = quadf(@innerintegral, ymin, ymax, tol, trace, intfcn, ...Error in ==> triplequad at 53Q = dblquad(@innerintegral, ymin, ymax, zmin, zmax, tol, quadf, intfcn, ...Can someone help please to understand why it's not working for this example ? does triple quad not support vectors included in functions ?Thanks