You may use built-in MATLAB functions for this problem The data in the attached file shows the emissions of carbon dioxide from four categories of sources (coal, natural gas, petroleum, bio-fuels) over several years. The columns from Aviation Gasoline (Column D) through Other (Column M) together are petroleum derivatives while the last three columns "Wood", "Waste" and "Fuel ethanol" are bio-fuels. The emissions from petroleum would be the sum of the emissions of the various types of petroleum products. Likewise for bio-fuels. Write the following functions: 1. Emissions = getEmissions ByYear (data, year) This function should take as its first argument a matrix containing the data from the table, and as its second argument an integer for the year for which

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question
Matlab coding
Problem 2
You may use built-in MATLAB functions for this problem
The data in the attached file shows the emissions of carbon dioxide from four categories of sources (coal, natural gas,
petroleum, bio-fuels) over several years. The columns from Aviation Gasoline (Column D) through Other (Column M)
together are petroleum derivatives while the last three columns "Wood", "Waste" and "Fuel ethanol" are bio-fuels. The
emissions from petroleum would be the sum of the emissions of the various types of petroleum products. Likewise for
bio-fuels. Write the following functions:
1. Emissions = getEmissions ByYear (data, year) This function should take as its first argument a
matrix containing the data from the table, and as its second argument an integer for the year for which
emissions are to be determined. The return value is a 1 x 4 vector with the emissions for the four categories of
sources in the following order: 1) Coal, 2) Natural gas, 3) Petroleum, 4) Bio-fuels.
a. If data for the year specified in the input argument is not available, then your code should return 0 for
all elements of the return value.
2. Emissions = totalEmissionsByYear (data) This function should take as its argument a matrix
containing the data from the table. The return value is a 1 x 4 vector with the total emissions for the four
categories of sources in the following order: 1) Coal, 2) Natural gas, 3) Petroleum, 4) Bio-fuels.
Transcribed Image Text:Problem 2 You may use built-in MATLAB functions for this problem The data in the attached file shows the emissions of carbon dioxide from four categories of sources (coal, natural gas, petroleum, bio-fuels) over several years. The columns from Aviation Gasoline (Column D) through Other (Column M) together are petroleum derivatives while the last three columns "Wood", "Waste" and "Fuel ethanol" are bio-fuels. The emissions from petroleum would be the sum of the emissions of the various types of petroleum products. Likewise for bio-fuels. Write the following functions: 1. Emissions = getEmissions ByYear (data, year) This function should take as its first argument a matrix containing the data from the table, and as its second argument an integer for the year for which emissions are to be determined. The return value is a 1 x 4 vector with the emissions for the four categories of sources in the following order: 1) Coal, 2) Natural gas, 3) Petroleum, 4) Bio-fuels. a. If data for the year specified in the input argument is not available, then your code should return 0 for all elements of the return value. 2. Emissions = totalEmissionsByYear (data) This function should take as its argument a matrix containing the data from the table. The return value is a 1 x 4 vector with the total emissions for the four categories of sources in the following order: 1) Coal, 2) Natural gas, 3) Petroleum, 4) Bio-fuels.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Properties of Pure Substances
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY