Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

help me out with question 1 using matlab please. Given the following integral an

ID: 643980 • Letter: H

Question

help me out with question 1 using matlab please.

Given the following integral and its numerical approximation: Problem 1: Write a function called solvelntegral that takes a user defined triangle x as its input and returns the result, i.e. the numerical approximation resulting from the computation. If the input dx cannot evenly increment from 1 to 2 (e.g. dx =0.15), you may round to the nearest number of increments (e.g. dx = 0.15 has 6.67 increments which rounds to 7 increments or dx = 1/7). function res = solvelntegral(dx)

Explanation / Answer

function res = solveIntegral( dx )
%   Detailed explanation goes here
increment = 1/dx;

increment = ceil(increment);
dx = 1/increment;

res=0;
for i=1:dx:2
    res = res + sin(i)*dx/i;
end

end