Question: MATHLAB QUESTION: (do not use loop) Write a function called hw2_problems that scores a multiple-choice test. The function has two inputs: row vectors of integers

MATHLAB QUESTION: (do not use loop)

MATHLAB QUESTION: (do not use loop) Write a function called hw2_problems that

Write a function called hw2_problems that scores a multiple-choice test. The function has two inputs: row vectors of integers of the same length. The first input called key has the correct answers, while the second input called answers has the student's solutions. The function returns a single output argument, a scalar containing the number of correct answers. If any of the two inputs is not a row vector or they have different lengths, the function returns minus 1. Hint: See what MATLAB does with something like this: = randi(4,1,20); == >> V = randi(4,1, 20); W >> res = (v w) res = 1x20 logical array 1 0 1 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1

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!