function [Iw_o] = function_gauss_quadrature(Iw) % %UNTITLED Summary of this function goes here % % Detailed explanation goes here % % %Iw=[1 2;4 5;7 8;10 11]; % Dummy Iw matrix [m,n]=size(Iw); % Determine size of Iw p=4; % Number of points % Weights with multiplier 2pi, Vedula IITB multiplier=2*pi; % Multiply weights by 2pi as per RPV - CHECK w1=0.5*multiplier; w2=0.5*multiplier; w3=0.5*multiplier; w4=0.5*multiplier; w(1)=w1; % Array of weights w(2)=w2; w(3)=w3; w(4)=w4; for i=1:m Iwo(i,:)=0.5*(w(i).*Iw(i,:)); % 0.5 in integral end Iw_o=sum(Iwo); % Coloums are summed, will return 1D array end