Question: 2 . Extract all the electrical output datapoints: Electricity output ( GWh ) and store it to a 3 2 x 3 matrix. Make sure

2. Extract all the electrical output datapoints: Electricity output (GWh) and store it to a 32x3 matrix. Make sure that each energy source is contained in a column. Also create a 1x3 cell array that stores the energy source names from the datafile (consider the readcell() function).3. Extract the dates as a 32x1 column vector (exclude the provisional year).4. Extract the provisional year (incomplete last year of 2022) datapoints. 5. Append the year 2022 as the last element of the dates vector.6. Create a copy of the data variable and scale the fossil fuel data down by a factor of 10. Also create the cell array that is needed for the legend shown below:7. Plot the energy sources output data for all years (1990-2022). Use the below figure as a reference.8. Fill the missing values of the dataset (the provisional year) with estimated values based on a moving average mean of the previous years as follows: a)5 year window, b)10 year window c)15 year window and d)20 year window. Store each vector of results as another row in a matrix. First implement it with manually repeated code then improve the code to make use of a for loop instead. Hint: Replace the last year's datapoints with NaN before estimating.9. Plot the estimated data versus the provided 2022 data for all the sources (refer to example for more details on the figure):10. Analyse the figure and give your own interpretation about the following:
Which estimate performed the best? Motivate your answer based on the figure data.How did the Fossil energy source estimation perform over the four time spans?How did the Nuclear energy source estimation perform over the four time spans?How did the Renewable energy source estimation perform over the four time spans?How did the Renewable energy source versus the Nuclear energy source estimation perform over the four time spans?11. Determine the error percentages between the four estimated electrical outputs for 2022 and the given data. The result should be stored in a 4x4 matrix with each estimate as a column.
Use the formula:12. Plot the error data with proper annotations (refer to example) to clearly distinguish between the different estimates.

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!