The area of a circle is πr2. Define r as 5, and then find the area of a circle.
Part a)
The area of a circle is πr2. Define r as 5, and then find the area of a circle.
Matlab:
r=5;
A=pi*(r^2)
A =
78.5398
Part b)
The surface area of a sphere is 4πr2. Find the surface area of a sphere with a radius of 10 ft
Matlab:
r=10;
A = (4*pi*(r^2))
A =
1.2566e+003
Part c)
The volume of a sphere is 4/3 πr3. Find the volume of a sphere with a radius of 2 ft
Matlab:
r = 2;
V = ((4/3)*pi*(r^3))
V =
33.5103
Part d)
The volume of a cylinder is πr2 h. Define r as 3 and h as the matrix
h = [1, 5, 12]
Find the volume of the cylinders
Matlab:
r = 3;
h = [1, 5, 12];
V = (pi*(r^2)*h)
V =
28.2743 141.3717 339.2920
Part e)
The area of a triangle is ½ bh, where b is the base and h is the height. Define the base as the matrix
b = [2, 4, 6]
and the height as 12, and find the area of the triangles
Matlab:
b = [2, 4, 6];
h = 12;
A = ((1/2)*b*h)
A =
12 24 36