Problem 2972. Sum of the Multiplication of Vectors

Solution 3672898

Submitted on 16 Nov 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = [9 2 0 4]; y = [3 9 5 8]; z_correct = 77; assert(isequal(sum_of_multiplication(x, y),z_correct))

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in sum_of_multiplication (line 2) sum(x*y); Error in Test1 (line 4) assert(isequal(sum_of_multiplication(x, y),z_correct))

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!