(Solved): xL=% left limit of x xR= right limit of x panels = number of panels deltax =(xRxL)/ pa ...
xL=…% left limit of xxR=… right limit of x panels =… number of panels deltax =(xR−xL)/ panels; % panel width h= deltax; % height, h total_area =0.0;% total area for x=xL:h:(xR−h)% begin integration b1=…% base 1 b2 =… base 2 area =0.5∗h∗(b1+b2);% panel area total_area = total_area + area; % add panel area to end % total area total_area % report total area Use the template to find the numerical integration of function f(x) defined in MATLAB code as: f(x)=cos(x∧4)−log(2+x) from x=2.5 to x=5.2, using 500 trapezoid panels. Report the answer you get as a floating point number like 123.4 and not like 1.234e3. The output could be a negative value. Note that log() is the natural log function (In) in MATLAB.