Question: % Problem 2 . 8 % a ) The volume of a cylinder is v = pi * r ^ 2 * h % Define

% Problem 2.8
% a) The volume of a cylinder is v= pi * r^2*h
% Define the radius, r, as 3 and the height, h, as the matrix
% h =[1,5,12]
r =3;
h =[1,5,12];
% Find the volume of the cylinders by performing an array calculation. This means you must use array operators
% Your answer should be an array named vol.
% Enter the code to find the volume, vol here
% b) The area of a triangle is 1/2 the length of the base of the triangle, times the height of the triangle.
% Define the base as the matrix
% b =[2,4,6]
% and the height, h, as 12.
% Find the area of the triangles by performing an array calculation. Your answer should be an array named area.
b =[2,4,6];
h =12;
% Enter the code to find the area, named area, here
%*********************************************************************
% Although you don't have to use the .* operator for both
% multiplications and the ./ for the division it won't hurt if you do
% and is good practice
%*************************************************************************
% c) The volume of any right prism is the area of the base of the prism, times the vertical dimension of the prism.
% The base of the prism can be any shape, for example a circle, a rectangle or a triangle.
% Find the volume of the prisms created from the triangles in part b of this problem.
% Assume that the vertical dimension of these prisms is 6. Once again you must use an array calculation. Your answer should be an array named vol_prism.
% Redefine h here
% Calculate the volume of the prisms here and name the result vol_prism

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!