Question: Could you help writing a user defined function for part B and a for / while loop for part C . B . Averaging for

Could you help writing a user defined function for part B and a for/while loop for part C.
B. Averaging for Each Year - Write a user-defined function that calculates the average Ocean pH,
average Ocean CO2, and average atmospheric CO2 for a given year. The specification of the
function is as follows:
Inputs: the two data tables (TableOne & TableTwo), and the year (a scalar)
Outputs: Average Ocean pH, Ocean CO2, and Atmospheric CO2 for the specified year (3 scalars).
Use logical indexing and/or the find() function, NOT loops or if statements.
C. Using the function that you wrote in part B, calculate the average Ocean pH, Ocean CO2, and
Atmospheric CO2 for each year from 1988 to 2019. Store the results in a matrix with the
following format:
Column 1: year
Column 2: average Ocean pH
Column 3: average Ocean CO2
Column 4: average Atmospheric CO2
 Could you help writing a user defined function for part B

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 Databases Questions!