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

Using MATLAB Create a MATLAB *.m script file that will solve the following 2 pro

ID: 3817569 • Letter: U

Question

Using MATLAB Create a MATLAB *.m script file that will solve the following 2 problems. Use MATLAB array operations to solve the problems. When cars burn one gallon of gasoline, 19.4 pounds of CO_2 (carbon dioxide) is produced. Suppose you have a group of cars that have the following fuel efficiencies (miles per gallon): 117 mpg, 42 mpg, 38 mpg, 33.3 mpg, 31 mpg, 28 mpg, 23 mpg and 18 mpg. Create a row vector containing the fuel efficiencies. Use the appropriate array operations to calculate the amount of CO_2 produced for each car if the cars were driven for the following distances given in miles: 15000 miles for the car with 117 mpg, 13500 miles for the car with 42 mpg, 14000 miles for the car with 38 mpg, 11000 miles for the car with 33.3 mpg, 12500 miles for the car with 31 mpg, 8000 miles for the car with 28 mpg, 9500 miles for the car with 23 mpg, and 4000 miles with the car with 18 mpg. The amounts of CO_2 should be stored in a row vector. The distance a free-falling object falls is given by the equation D = 1/2gt^2 where D is the distance, g is the constant 9.8 meters per second, and t is time in seconds. Using either the colon operator or the linspace function create a row vector for times from 0 to 3 minutes in 5 second intervals (increments). The row vector should include 0 and 180) Using MATLAB array operations, calculate another row vector that contains the distance the object fell for each time. Make sure that you script file contains the clear and clc MATLAB commands and includes comments that describe the problem, input (even if it has been given), output, and processing.

Explanation / Answer

------Problem-1---------------------------

co2burnedForGallon = 19.4 %pounds
%fuel efficients in mpg - miles per gallon
fuelEfficients = [117 42 38 33.3 31 28 23 18]
%distance travelled in miles
distTravelled = [15000 13500 14000 11000 12500 8000 9500 4000]
% Gasoline burnt = distTravelled / fuel Efficiens
gasGallonsBurnt = distTravelled ./ fuelEfficients
%amount of co2 produced = Gasoline burn * co2Burned for Gallon
co2Produced = gasGallonsBurnt .* co2burnedForGallon

----------output------------

co2burnedForGallon = 19.4 %pounds
%fuel efficients in mpg - miles per gallon
fuelEfficients = [117 42 38 33.3 31 28 23 18]
%distance travelled in miles
distTravelled = [15000 13500 14000 11000 12500 8000 9500 4000]
% Gasoline burnt = distTravelled / fuel Efficiens
gasGallonsBurnt = distTravelled ./ fuelEfficients
%amount of co2 produced = Gasoline burn * co2Burned for Gallon
co2Produced = gasGallonsBurnt .* co2burnedForGallon

----------------------------Problem 2-----------------------------------

g = 9.8 %m/s
%time interval 0 to 3 minutes with 5 seconds interval
%initialize row vector
t = 0:5:180
%distance fell = 1/2 g t^2 = (g/2) t^2
dist = (t .^2) .* (g/2)

-----output-----------------------

g = 9.8000
t =

Columns 1 through 13:

     0     5    10    15    20    25    30    35    40    45    50    55    60

Columns 14 through 26:

    65    70    75    80    85    90    95   100   105   110   115   120   125

Columns 27 through 37:

   130   135   140   145   150   155   160   165   170   175   180

temp =

Columns 1 through 6:

   0.0000e+00   1.2250e+02   4.9000e+02   1.1025e+03   1.9600e+03   3.0625e+03

Columns 7 through 12:

   4.4100e+03   6.0025e+03   7.8400e+03   9.9225e+03   1.2250e+04   1.4823e+04

Columns 13 through 18:

   1.7640e+04   2.0702e+04   2.4010e+04   2.7563e+04   3.1360e+04   3.5402e+04

Columns 19 through 24:

   3.9690e+04   4.4222e+04   4.9000e+04   5.4023e+04   5.9290e+04   6.4803e+04

Columns 25 through 30:

   7.0560e+04   7.6562e+04   8.2810e+04   8.9302e+04   9.6040e+04   1.0302e+05

Columns 31 through 36:

   1.1025e+05   1.1772e+05   1.2544e+05   1.3340e+05   1.4161e+05   1.5006e+05

Column 37:

   1.5876e+05

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