Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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)
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 1Step 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