e called "flow_rate.dat". wnload the file "flow_rate.dat", (i.e. right click and select "Save link as..") and save ur current working directory in MATLAB. Reading data from a file in MATLAB is acco ng the load function. In the "Command Window" or in your script file, type: >> load flow_rate.dat ere are 2 rows in "flow_rate.dat". The first row represents the # of hours and the sec presents the data for the flow rate of the river in cubic feet per second. The above commer nd the data from the file and store the result in a matrix variable called "flow_rate". Hen ommand Window", type: >> flow_rate is will display the both columns of data in the matrix "flow_rate".

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Matlab Question
56780
9
load flow_rate.dat
flow_rate
Command Window
Flow_rate=
0
800
2
980
4
1140
6
1320
8
1400
10
1490
12
1440
14
1180
16
1100
Transcribed Image Text:56780 9 load flow_rate.dat flow_rate Command Window Flow_rate= 0 800 2 980 4 1140 6 1320 8 1400 10 1490 12 1440 14 1180 16 1100
A river's water flow rate is measured every 2 hours. The flow rate has been recorded and stored in a
file called "flow_rate.dat".
Download the file "flow rate.dat", (i.e. right click and select "Save link as..") and save it under
your current working directory in MATLAB. Reading data from a file in MATLAB is accomplished
using the load function. In the "Command Window" or in your script file, type:
>> load flow_rate.dat
There are 2 rows in "flow_rate.dat". The first row represents the # of hours and the second row
represents the data for the flow rate of the river in cubic feet per second. The above commend would
read the data from the file and store the result in a matrix variable called "flow_rate". Hence, in the
"Command Window", type:
>> flow_rate
This will display the both columns of data in the matrix "flow_rate".
Write a script that will fit a cubic function to the data and create a plot with 100 points for the fitted
function. Also, plot the original data as "black circles" on the same graph. The title for the plot
should include the degree of the fitted polynomial. Include appropriate x and y labels for the plot.
Suppose the water's flow rate eventually drops to zero. Use the best-fitted function to predict and
print out the # of hours it takes the water's flow rate to drop to zero.
Transcribed Image Text:A river's water flow rate is measured every 2 hours. The flow rate has been recorded and stored in a file called "flow_rate.dat". Download the file "flow rate.dat", (i.e. right click and select "Save link as..") and save it under your current working directory in MATLAB. Reading data from a file in MATLAB is accomplished using the load function. In the "Command Window" or in your script file, type: >> load flow_rate.dat There are 2 rows in "flow_rate.dat". The first row represents the # of hours and the second row represents the data for the flow rate of the river in cubic feet per second. The above commend would read the data from the file and store the result in a matrix variable called "flow_rate". Hence, in the "Command Window", type: >> flow_rate This will display the both columns of data in the matrix "flow_rate". Write a script that will fit a cubic function to the data and create a plot with 100 points for the fitted function. Also, plot the original data as "black circles" on the same graph. The title for the plot should include the degree of the fitted polynomial. Include appropriate x and y labels for the plot. Suppose the water's flow rate eventually drops to zero. Use the best-fitted function to predict and print out the # of hours it takes the water's flow rate to drop to zero.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education