Question: Read all instructions COMP1200- MATLAB - assign06 NOTE: Your submitted file(s) MUSTbefore beginning your work. Due 11:59 pm Friday March 8, 2019 be spelled and
Read all instructions COMP1200- MATLAB - assign06 NOTE: Your submitted file(s) MUSTbefore beginning your work. Due 11:59 pm Friday March 8, 2019 be spelled and cased as instructed.
Submitassign06a.m,assign06b.m,assign06c.m viaCanvas
Before you start writing your program:
Download and save a copy of lake_powell.txt in the folder where you will save your assign06 programs. The functions will look in the current folder for the data file.
Problem:
From MATLAB for Engineers, 5e, 2018, H. Moore , p.312, (4e, 2012, p306). These instructions replace the instructions in the text.The Colorado River Drainage Basin covers parts of seven western states. A series of dams
has been constructed on the Colorado River and its tributaries to store runoff water and to generate low-cost hydroelectric power. The ability to regulate the flow of water has made the growth of agriculture and population in these arid desert states possible. Even during periods of extended drought, a steady, reliable source of water and electricity has been available to the basing states. Lake Powell is one of these reservoirs.lake_powell.txt contains data on the water level (feet above sea level) in the reservoir for the four years 2013 to 2016.
Instructions for all assignments scripts:
See Standards for Documentation of MATLAB Programs on the Canvas Resources page. Insert comments at the top and throughout each file.
Submit before assign06
BEFOREyou leave for SPRING BREAK
o Include the follow comments at the beginning of this (and ALL) files. % submitters name, GROUP # Grade of ZERO for files if submitter name not part of Canvas group.
Not in a group? GROUP# is none. For your own protection,% other group members names type none if submitting alone.
%programfilename,ex.assign02a.m ALLSTUDENTSNAMESMUSTMATCHNAMESONCANVAS. % due date of the assignment % statement about collaboration REQUIRED, even if you didnt collaborate. See syllabus for examples.% a short narrative about what the file does MODIFY narrative to include current requirements.
o Use the algorithm given as comments throughout your program.
-
Observe the instructors rule for naming variables.
o Use ALL CAPS for constants variable names.o Start other variables with lower case. o Use descriptive variable names.
-
Use Sample Input/Output as a guide.
-
Code clarity:
o Indent blocks as needed. Use Smart Indent. o Divide your solution program code into sections as noted in the
algorithm.
Use blank lines as needed to group statements. o Use section comments as well as the algorithm step comments. o Remove statements from previous assignments that do not apply to the
current requirements.
If you do not submit individually, there will be a 5 POINTS PENALTY for not joining a group on Canvas. Groups can be 2-4 students. DO NOT join a group unless you have worked with the other members. If you do, you will be removed from the group and given the grade of zero.
MINUS FIVE POINTS for not having the CORRECT CURRENT GROUP NUMBER in your comments.
Program: assign06a.m Revise your assign05.m by adding the exist() function to print a message only if the data file is not available. The output should be the same as with assign05.m.
New commands
COMP1200m Spring 2019 assign06 p. 1 of 2
exist()
Program: assign06b.m REMOVE UNNECESSARY STATEMENTS FROM PREVIOUS PROGRAMS. INCLUDE APPROPRIATE COMMENTS. Check the file ID to determine if the file is available.
Only print message if file is not available. Use nested for loops to read one water level value at a time into the lake_powellmatrix. lake_powell(month,year) = fscanf(fileID, '%f', 1);. Use mean to determine the average elevation of the water level for each year and the
overall average for the four-year period over which the data were collected. Print the
yearly average vector and the overall average with labels as shown below.
Additional Problem Constants: (with unit comments)data file name
New commands
fopen() fscanf()nested for loops
Continue to use
fprintf()
Print water level with 2 decimal places Print year, month with 0 decimal places Align numbers under headings Use constant names
New commands
textread()
save selected columns of a file
Continue to use
fprintf()
Print water level with 2 decimal places Print year, month with 0 decimal places Align numbers under headings
Use constant names
Output: Average for Each Year (in feet) 2013 2014 2015 2016
3579.90 3585.70 3600.78 3602.36 Overall average: 3592.18 feet
Program: assign06c.m REMOVE UNNECESSARY STATEMENTS FROM PREVIOUS PROGRAMS. INCLUDE APPROPRIATE COMMENTS. Use exist() to determine if the file is available. Only print message if file is not
available. Use textread() to save the first and last years into a two column matrix.
Do not save the other years. Do not use a loop. Print the lake_powell matrix with title and year column headings.
Do not use a loop to print matrix. Use mean to determine and print the average elevation of the water for each month for
the four-year period. Create a 2-column table of the results; print the table. See
example 7.2, p.254.
Problem Constants: (with unit comments)as given in previously 05 and 06
Output:
Lake Powell Water Levels (in feet) 2013 2016
3594.38 3601.41 3589.11 3598.63 3584.49 3597.85 3583.02 3599.75 3584.70 3604.68 3587.01 3610.94 3583.07 3609.47 3575.85 3605.56 3571.07 3602.27 3570.70 3601.27 3569.69 3599.71 3565.73 3596.79
Average elevation (in feet) of the water for each month Month Elevation
1 3597.89 2 3593.87 3 3591.17 4 3591.39 5 3594.69 6 3598.98 7 3596.27 8 3590.70 9 3586.67
10 3585.98 11 3584.70 12 3581.26
.Submit via Canvas:assign06a.m
assign06b.m
assign06c.m
MATLAB script files COMP1200m Spring 2019 assign06 p. 2 of 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
