Hi All, My question to all is that .......... I have to add the elements with in the matrix.........
Show older comments
2 1 2
1 1 1
1 1 1
i want to add a(1,2)and a(2,1) and then multiply it with a(1,1) and so on for each element to generate a new matrix........
for a(2,2)..... we will have to do a(2,2) * ( a(1,2)+a(2,3)+a(3,2)+ a(2,1))
this a simple case and i have made the program for 3 by 3 matrix....... but how to generalize it for and n X n Matrix, where n is any number.
thanks for your guidance..........
1 Comment
Offroad Jeep
on 22 Mar 2015
Accepted Answer
More Answers (1)
Image Analyst
on 7 Mar 2015
It looks like you want to multiply the original image by convolution of it. Try this
kernel = [0, 1, 0; 1, 0, 1; 0, 1, 0]; % Make a "cross" or "+" shape.
sumImage = conv2(originalImage, kernel, 'same'); % Sum and add.
outputImage = originalImage .* sumImage; % Multiply.
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!