By Matlab only please By Matlab only please Evaluate the fol

By Matlab only please.. By Matlab only please

Evaluate the following triple integral using single applications of Simpson’s 1/3 rule. Please by matlab code only

(x3-3y2) dxdydz 2J0 J- 3

Solution

func = @(x, y, z) x*x*x - 3*y*z;

%integrate w.r.t. x
p = -3;
q = 1;
func = @(y, z) (((q - p)*1.0)/6.0)*( func(p, y, z) + 4*func(((p + q)*1.0)/2.0, y, z) + func(q, y, z) );

%integrate w.r.t. y
p = 0;
q = 2;
func = @(z) (((q - p)*1.0)/6.0)*( func(p, z) + 4*func(((p + q)*1.0)/2.0, z) + func(q, z) );

%integrate w.r.t. z
p = -2;
q = 2;
result = (((q - p)*1.0)/6.0)*( func(p) + 4*func(((p + q)*1.0)/2.0) + func(q) );
disp( result );

By Matlab only please.. By Matlab only please Evaluate the following triple integral using single applications of Simpson’s 1/3 rule. Please by matlab code only

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site