Cody

Problem 42521. To convolve two vectors

Solution 2405559

Submitted on 28 May 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
p=[1 3 4]; q=[4 6 9]; y_correct = [4 18 43 51 36]; assert(isequal(convolution(p,q),y_correct))

Matrix dimensions must agree. Error in convolution (line 5) y(i) = sum(p.*q); Error in Test1 (line 4) assert(isequal(convolution(p,q),y_correct))

2   Fail
p=[8 3]; q=[2 5]; y_correct = [16 46 15]; assert(isequal(convolution(p,q),y_correct))

Matrix dimensions must agree. Error in convolution (line 5) y(i) = sum(p.*q); Error in Test2 (line 4) assert(isequal(convolution(p,q),y_correct))

Suggested Problems

More from this Author18

Community Treasure Hunt

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

Start Hunting!