Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3: Download the uspopulation.mat file from Canvas into the same folder as your code and load the data into your Matlab workspace using load('uspopulation').

image text in transcribed
image text in transcribed
Problem 3: Download the uspopulation.mat file from Canvas into the same folder as your code and load the data into your Matlab workspace using load('uspopulation'). This native Matlab data file contains population of the U.S. recorded by the U.S. Census from 1790-1990 in 10 year increments (loading the mat file creates a Matlab variable pop and years). Plot a scatterplot of the US population over these years using red circles. Next, use Matlab to find a quadratic polynomial function that fits the data using the polyfit function. Then, evaluate the resulting polynomial using the polyval function and plot the predicted polynomial fit curve on the same plot using a solid black line to see how the fit curve matches the U.S. Population Quadratic Model data. Add a title, x and y label, and a legend to the plot using Matlab commands. Increase the overall font size to 12. Cars Data Model 2 15 U.S. Population Finally, use the polyval function to evaluate the predicted population in 2020. If the actual US population in 2020 was 331 million, find and display the % difference between your predicted value and the actual value (answer should be 0.336%). Use the same technique to predict the estimated US population in 2050 and output your prediction using fprintf. OS 0 1750 1800 1850 1900 1950 2000 Year function importfile (fileToReadl) IMPORTFILE (FILETOREAD1) Imports data from the specified file FILETOREADI: file to read Auto-generated by MATLAB on 08-Feb-2021 14:20:59 * Import the file newDatal = load(!-mat', fileToReadi); Create new variables in the base workspace from those fields. vars fieldnames (newDatal); for 1 = 1:length (vars) assignin('base', vars(i), newDatal. (vars(i))); end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago

Question

=+ 2. What is the opportunity cost of seeing a movie?

Answered: 1 week ago