Cody

Problem 44950. Calculate Inner Product

Solution 3561925

Submitted on 6 Nov 2020 by Tim George
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))

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

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

z = "The inner dimensions do not match."

Suggested Problems

More from this Author13

Community Treasure Hunt

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

Start Hunting!