Question: Write a MatLab function for the following: Do not use conditionals or hard code Function Name: GSquare nputs: 1. (double) A 1x(2 N 1)vector of

Write a MatLab function for the following:

Do not use conditionals or hard code

Write a MatLab function for the following: Do not use conditionals orhard code Function Name: GSquare nputs: 1. (double) A 1x(2 N 1)vector

Function Name: GSquare nputs: 1. (double) A 1x(2 N 1)vector of homework grades 2. (double) A 1xN vector of comment grades 3. (char) An Nx3 character array representing the grade mode outputs: 1. double The final homework grade Background: As part of an assignment to work on your WOVEN skills for English class, you are assigned a pen-pal in a foreign country who you correspond with through email and vlogs. It just so happens that your pen-pal happens to attend the best engineering school in Georgia, and is also currently taking a CS class! At the end of the semester, he informs you via vlog that his homework grades for the class are not reported correctly in his online gradebook since the software, GSquare, is incapable of taking into account whether a homework assignment is the maximum or average of his original and resubmission. Since he tells you that he too cannot do this simple math, and that his TAs told him at the beginning of the semester not to ask what his real homework grade should be, you offer to write a function that will do it for him. Function Description: The first input represents your homework grades, alternating between the respective assignment's original grade and resubmission grade. The rest of the elements follow this alternating pattern except for the final entry, which is the grade on the extra credit assignment. in1 [100 0 950 75 95 88 HW1 HW2 HW3 EC The second input represents your comment grades, which can add up to 10 additional points per homework. So a 95 comment grade adds 9.5 points. in 100 95 HW1 HW2 HW3 The third input will be a character array with rows reading either 'avg' or 'max', which will determine whether you should take the average or maximum of the original and resubmission grades for the corresponding homework. in avg max avg Use this information to calculate the overall homework grade. Remember that a resubmission can never hurt your grade, only improve it: if the resubmission grade is lower, or if the assignment was not re-submitted (represented by a 0), then the resubmission grade should Function Name: GSquare nputs: 1. (double) A 1x(2 N 1)vector of homework grades 2. (double) A 1xN vector of comment grades 3. (char) An Nx3 character array representing the grade mode outputs: 1. double The final homework grade Background: As part of an assignment to work on your WOVEN skills for English class, you are assigned a pen-pal in a foreign country who you correspond with through email and vlogs. It just so happens that your pen-pal happens to attend the best engineering school in Georgia, and is also currently taking a CS class! At the end of the semester, he informs you via vlog that his homework grades for the class are not reported correctly in his online gradebook since the software, GSquare, is incapable of taking into account whether a homework assignment is the maximum or average of his original and resubmission. Since he tells you that he too cannot do this simple math, and that his TAs told him at the beginning of the semester not to ask what his real homework grade should be, you offer to write a function that will do it for him. Function Description: The first input represents your homework grades, alternating between the respective assignment's original grade and resubmission grade. The rest of the elements follow this alternating pattern except for the final entry, which is the grade on the extra credit assignment. in1 [100 0 950 75 95 88 HW1 HW2 HW3 EC The second input represents your comment grades, which can add up to 10 additional points per homework. So a 95 comment grade adds 9.5 points. in 100 95 HW1 HW2 HW3 The third input will be a character array with rows reading either 'avg' or 'max', which will determine whether you should take the average or maximum of the original and resubmission grades for the corresponding homework. in avg max avg Use this information to calculate the overall homework grade. Remember that a resubmission can never hurt your grade, only improve it: if the resubmission grade is lower, or if the assignment was not re-submitted (represented by a 0), then the resubmission grade should

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 Databases Questions!