Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Read all instructions before beginning your work. COMP1200- MATLAB - assign06 Due 11:59 pm - Friday - March 8, 2019 NOTE: Your submitted file(s) MUST
Read all instructions before beginning your work. COMP1200- MATLAB - assign06 Due 11:59 pm - Friday - March 8, 2019 NOTE: Your submitted file(s) MUST be spelled and cased as instructed Submit assign0 6a.m, assign0 6a.m, assign06a.m via Canvas Before you start writing your program Download and save a copy of lake_powel1.txt in the folder where you will save your assign06 will look in the current folder for the data file. programs. The functions 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-powe . txt contains data on the water level (feet above sea level) in the reservoir for the four years 2013 to 2016 Submit before assign06 BEFORE you leave for SPRING BREAK 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 o Include the follow comments at the beginning of this (and ALL) files % submitter's 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. % due date of the assignment % statement about collaboration % a short narrative about what the file does REQUIRED, even if you didn't collaborate. See syllabus for examples. MODIFY narrative to include current requirements. o Use the algorithm given as comments throughout your program. Observe the instructor's rule for naming variables. o Use ALL CAPS for constants variable names o Start other variables with lower case. 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. Use descriptive v Use Sample Input/Output as a guide. Code clarity: ariable names. O Indent blocks as needed. Use Smart Indent. Divide your solution program code into sections as noted in the algorithm. Use blank lines as needed to group statements. Use section comments as well as the algorithm step comments. Remove statements from previous assignments that do not apply to the current requirements o o MINUS FIVE POINTS for not having the CORRECT CURRENT GROUP NUMBER in your comments. o o Program: assign06a.m Revise your assign05.m by adding the exist () is not available. The output should be the same as with assigno5.m. n to print a message only if the data file New commands exist() Program: assign06b.m REMOVE UNNECESSARY STATEMENTS FROM PREVIOUS PROGRAMS INCLUDE APPROPRIATE COMMENTS Check the file ID to determine if the file is available New commands fopen ) fscanf () nested for loops Only print message if file is not available Use nested for loops to read one water level value at a time into the lake_powell matrix. Continue to use fprintf ) Print water level with 2 decimal places lake-powell (month, year) -fscanf(file!D, '%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 Print year month with Additional Problem Constants: (with unit comments) 0 decimal places data file name Output Align numbers under headings Use constant names 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 New commands textread () save selected columns of a file Use textread () to save the first and last years into a two column matrix. Print the lake_powe1l matrix with title and year column headings. Use mean to determine and print the average elevation of the water for each month for available Do not save the other years. Do not use a loop Do not use a loop to print mat the four-year period. Create a 2-column table of the results; print the table. See Continue to use fprintf () Print water level with 2 decimal places Print year, month with decimal places Align numbers under headings rix example 7.2, p.254 Problem Constants: (with unit comments) as given in previously 05 and 06 Use constant names Output Lake Powell Water Levels in feet) 2013 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 2016 Average elevation in feet) of the water for each month Month Elevation 3597.89 3593.87 3591.17 3591.39 3594.69 3598.98 3596.27 3590.70 3586.67 3585.98 3584.70 3581.26 10 12 Read all instructions before beginning your work. COMP1200- MATLAB - assign06 Due 11:59 pm - Friday - March 8, 2019 NOTE: Your submitted file(s) MUST be spelled and cased as instructed Submit assign0 6a.m, assign0 6a.m, assign06a.m via Canvas Before you start writing your program Download and save a copy of lake_powel1.txt in the folder where you will save your assign06 will look in the current folder for the data file. programs. The functions 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-powe . txt contains data on the water level (feet above sea level) in the reservoir for the four years 2013 to 2016 Submit before assign06 BEFORE you leave for SPRING BREAK 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 o Include the follow comments at the beginning of this (and ALL) files % submitter's 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. % due date of the assignment % statement about collaboration % a short narrative about what the file does REQUIRED, even if you didn't collaborate. See syllabus for examples. MODIFY narrative to include current requirements. o Use the algorithm given as comments throughout your program. Observe the instructor's rule for naming variables. o Use ALL CAPS for constants variable names o Start other variables with lower case. 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. Use descriptive v Use Sample Input/Output as a guide. Code clarity: ariable names. O Indent blocks as needed. Use Smart Indent. Divide your solution program code into sections as noted in the algorithm. Use blank lines as needed to group statements. Use section comments as well as the algorithm step comments. Remove statements from previous assignments that do not apply to the current requirements o o MINUS FIVE POINTS for not having the CORRECT CURRENT GROUP NUMBER in your comments. o o Program: assign06a.m Revise your assign05.m by adding the exist () is not available. The output should be the same as with assigno5.m. n to print a message only if the data file New commands exist() Program: assign06b.m REMOVE UNNECESSARY STATEMENTS FROM PREVIOUS PROGRAMS INCLUDE APPROPRIATE COMMENTS Check the file ID to determine if the file is available New commands fopen ) fscanf () nested for loops Only print message if file is not available Use nested for loops to read one water level value at a time into the lake_powell matrix. Continue to use fprintf ) Print water level with 2 decimal places lake-powell (month, year) -fscanf(file!D, '%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 Print year month with Additional Problem Constants: (with unit comments) 0 decimal places data file name Output Align numbers under headings Use constant names 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 New commands textread () save selected columns of a file Use textread () to save the first and last years into a two column matrix. Print the lake_powe1l matrix with title and year column headings. Use mean to determine and print the average elevation of the water for each month for available Do not save the other years. Do not use a loop Do not use a loop to print mat the four-year period. Create a 2-column table of the results; print the table. See Continue to use fprintf () Print water level with 2 decimal places Print year, month with decimal places Align numbers under headings rix example 7.2, p.254 Problem Constants: (with unit comments) as given in previously 05 and 06 Use constant names Output Lake Powell Water Levels in feet) 2013 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 2016 Average elevation in feet) of the water for each month Month Elevation 3597.89 3593.87 3591.17 3591.39 3594.69 3598.98 3596.27 3590.70 3586.67 3585.98 3584.70 3581.26 10 12
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started