Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

2D Matrix Convolution in MATLAB.

Status
Not open for further replies.

mawais

Junior Member level 2
Joined
Mar 4, 2009
Messages
20
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,433
Hello I am trying to do 2D convolution in MATLAB.
its easier to do it with conv2 function. I was wondering if I could do it like this.
computing convolution in x-direction and then in y-direction using linear convolion function conv in MATLAB, and finally combining them to obtain a same result as that of conv2.
Please reply if it is possible then how to combine two convolution matrices generated from those in x and y directioins.
Best regards,
Awais.

Added after 51 minutes:

Code:
a=magic(2);
b=magic(2);
c=conv2(a,b);
c1=conv(a(1,:),b(1,:));
c2=conv(a(2,:),b(2,:));
c3=conv(a(:,1),b(:,1));
c4=conv(a(:,2),b(:,2));

Can anyone explain how to get a 3x3 matrix same as that resulted from conv2
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top