MATLAB Answers

0

How to make a code using flip & slide method and without using conv function ?

Asked by argyn ramz on 3 Aug 2019
Latest activity Edited by Image Analyst
on 4 Aug 2019
Example given, depends on how many user inputs: x = [userinputs]
x = [1 2 3];
h = [4 5 6];
Illustration pattern of the 5 element-by-element products (summing produces the convolution)
1 2 3
6 5 4 %first element is 4
1 2 3
6 5 4 %2nd element is 5+8
1 2 3
6 5 4 %3rd element is 6+10+12
1 2 3
6 5 4 %4th element is 12+15
1 2 3
6 5 4 %5th element is 18

  4 Comments

Show 1 older comment
Why do you keep editing the question multiple times without responding to any of the comments or answers??

Sign in to comment.

Products

1 Answer

Answer by Image Analyst
on 4 Aug 2019
 Accepted Answer

It's simply convolution:
x = [1 2 3];
h = [4 5 6];
output = conv(x, h)
output =
4 13 28 27 18

  1 Comment

If you don't want to use the conv() function, because it's your homework assignment (not ours), and want to write it yourself, you can do it with for loop(s). See my attached demo where I do it in 2-dimensions. It will be easy for you to adapt it to 1-D.

Sign in to comment.