Cody

Solution 2179989

Submitted on 28 Mar 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   Pass
x = [1 2]; y = [2;3]; z_correct = 8; assert(isequal(in_prod(x,y),z_correct))

z = 8 Have you checked the inner dimensions?

2   Pass
x = -5; y = 100; z_correct = -500; assert(isequal(in_prod(x,y),z_correct))

z = -500 Have you checked the inner dimensions?

3   Fail
x = [1 2 3]; y = [2;3]; assert(isStringScalar(in_prod(x,y)))

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 in_prod (line 2) z = x * y Error in Test3 (line 3) assert(isStringScalar(in_prod(x,y)))