The area moment of inertia
I
x
e
of a rectangle about the axis x0passing through its centroid is
I
x
e
=
1
12
b
h
3
. The moment of inertia about an axis x that is parallel to x0is given by Ix=
I
x
e
+
A
d
x
2
, where A is the area of the rectangle, and dxis the distance between the two axes. Write a MATLAB user-defined function that determines the area moment of inertia
I
x
e
of a I-beam about the axis that passes through its centroid (see drawing). For the function name and arguments use Ixc=IxcBeam(w, h, d, t), where the input arguments w, h, d, and t are the dimensions shown in the figure and the output argument Ixc is
I
x
e
. For finding the coordinate y of the centroid, use the user-defined function centroidI from the previous problem as a subfunction inside IxcBeam. (The moment of inertia of a composite area is obtained by dividing the area into parts and adding the moments of inertia of the parts.)
Use the function to determine the moment of inertia for a beam with w=10 in., h=8 in., d=6 in., and t=0.5 in.