Matrix sum

edited March 2009 in Science & Tech
Hi, if i have 2 matrix A(20x27) anb B(20x27) and i want to find this sum:
the 1st column of A with 1st of B
the 1st of A with 2nd of b
.
.
.
1st with 27th of b
2nd of A with 1st of B
2nd of A with 2nd of B
.
.
.
How can i do that?
Thank you!!

Comments

  • LincLinc Owner Detroit Icrontian
    edited March 2009
    So you want a sum of all of that combined? Just add all the numbers in both matrices and multiply by 27.
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited March 2009
    do you want to multiply them elementwise and sum the products? Be more clear with what you want to do.

    also post what you've tried so far.
  • edited March 2009
    Finally,i found the solution of this problem::)

    for ii = 27:-1:1
    for jj = 27:-1:1
    Result(:,jj+(ii-1)*27) = A(:,ii) + B(:,jj);
    end
    end
Sign In or Register to comment.