Hi,
I am trying to do matrix addition of 2*4 to fit in 4*4 matrix. I am using for loops to get me familiarize with loops so that i can use it for image matrix manupulation. But with my code my output is 2*4 instead of 4*4.. could someone explain me the concept or the logic i am lacking here ..
a = [11:14; 15:18]; b = [3 2 3 1; 2 1 1 1;1 3 3 2; 2 1 1 3];for i = 0 for j = 0 for x = 1:2 for y = 1:4 c(i+x,j+y) =b(i+x,j+y)+a(x+i,y+j); end end endend
Best Answer