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

Complete the function using matlab verview: In this exercise, you will create a

ID: 3598485 • Letter: C

Question

Complete the function using matlab

verview: In this exercise, you will create a function which can numerically approximate the x -coordinate of the centroid of an area. The area is defined as the area under fox)-2.66x2+5.65 between x 0 and x 5. A centroid is the geometric centre of a shape. The x coordinate of the centroid of an area, given the area is defined as the area between a function, f(x), and the x-axis, is the integral of x*f(x) divided by the integral of f(x). This is under the assumption that f(x) doesn't cross the x-axis. In this exercise, you will be approximating the integrals with MATLAB's integral function Inputs: one Outputs: xCentroid: The numerical approximate of the x-coordinate of the centroid of the area. Process: 1. Evaluate the integral of fx) 2.66x2+5.65 between x 0 and x 5 by applying MATLAB's integral function. 2. Evaluate the integral ofx*fx) x(2.66x2+5.65) between x 0 and x 5 by applying MATLAB's integral function 3. Evaluate xCentroid by dividing your solution from part 2 by your solution from part Function Template: function xCentroid-centroid %INSERT CODE end

Explanation / Answer

function xCentroid = centroid()
fx = @(x) 2.66.*x.*x + 5.65;
xfx = @(x) 2.66.*x.*x.*x + 5.65.*x;
  
intfx = integral(fx,0,5);
intxfx = integral(xfx,0,5);
xCentroid = intxfx/intfx;
end

xCentroid = centroid()

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote