Question 4: (6 marks) Please modify the MATLAB file Gauss_2D_tut.m from Tutorial 10 to integrate an analytic function f(x, y)=x*ev, using 2D Gaussian quadrature. Call this script Gauss_2D_tut_analytic.m You can use the same structure as Gauss_2D_tut.m but instead of a field, pass in a pointer to a function. Then fill in the table below for the following integral: SiL x*e" dxdy Gauss 2D # Gauss points 1x1 3x3 5x5 elfunction out = Gauss_2D_tut(a,b,c,d,N,M,A,X,Y) sfunction that integrates the field A using Gaussian integration % N,M : gauss points used along x and y. define Jacobian %YOUR CODE HERE % our gauss point library (file gw.m) contains coordinates defined in the 19,1] % interval. Therefore we use 2 variables ksi and eta defined in the [0,11 % interval which is equivalent to [a,b] for x and (c,d) for y coordinates. So that: % x=a+(b-a)*ksi; % y=C+(d-c)*eta; Shence Jacobian matrix: [d_x/d_ksi, d_x/d_eta; d_y/d_ksi, d_y/d_eta] % determinant of Jacobian matrix: J=det ( [(b-a), 0;0, (d-c)]); % define grid vectors [wx, ksig) = gw(N); [wy, etag] = gw(M); xg=a+ksig*(b-a); yg=c+etag*(d-c); [xxg, yyg] = ndgrid(xg, yg); [wwx, wwy] = ndgrid(wx, wy); ix = 1:N; iy = 1:M; %sample our image at interpolated grid points U = interp2(X,Y, A,xxg, yyg); s = sum( sum( U(ix, iy). *WWX. *wwy ) ); out=J*s; Question 4: (6 marks) Please modify the MATLAB file Gauss_2D_tut.m from Tutorial 10 to integrate an analytic function f(x, y)=x*ev, using 2D Gaussian quadrature. Call this script Gauss_2D_tut_analytic.m You can use the same structure as Gauss_2D_tut.m but instead of a field, pass in a pointer to a function. Then fill in the table below for the following integral: SiL x*e" dxdy Gauss 2D # Gauss points 1x1 3x3 5x5 elfunction out = Gauss_2D_tut(a,b,c,d,N,M,A,X,Y) sfunction that integrates the field A using Gaussian integration % N,M : gauss points used along x and y. define Jacobian %YOUR CODE HERE % our gauss point library (file gw.m) contains coordinates defined in the 19,1] % interval. Therefore we use 2 variables ksi and eta defined in the [0,11 % interval which is equivalent to [a,b] for x and (c,d) for y coordinates. So that: % x=a+(b-a)*ksi; % y=C+(d-c)*eta; Shence Jacobian matrix: [d_x/d_ksi, d_x/d_eta; d_y/d_ksi, d_y/d_eta] % determinant of Jacobian matrix: J=det ( [(b-a), 0;0, (d-c)]); % define grid vectors [wx, ksig) = gw(N); [wy, etag] = gw(M); xg=a+ksig*(b-a); yg=c+etag*(d-c); [xxg, yyg] = ndgrid(xg, yg); [wwx, wwy] = ndgrid(wx, wy); ix = 1:N; iy = 1:M; %sample our image at interpolated grid points U = interp2(X,Y, A,xxg, yyg); s = sum( sum( U(ix, iy). *WWX. *wwy ) ); out=J*s