Summation of two matrices
7 views (last 30 days)
Show older comments
Hi guys,
I really need your help with the summation of matrices in Matlab.
I have two matrices (180,360), which counts a total of 129 600 values, with different numbers. I would like to sum all the elements within this two matrices as follows:
- value from the 1st row and 1st coloumn of the 1st matrix sum with the value from the 1st row and 1st coloumn of the 2nd matrix,
- value from the 1st row and 2nd coloumn of the 1st matrix sum with the value of from the 1st row and 2nd coloum of the 2nd matrix,
- and so on until the end.
I tried to do next:
Z = A + B and I get only one value in the last row and last coloumn. All the others values are zero (0) even the values in the both matrices are NOT zero (0). I also tried to use funtion SUM like Z = sum (A + B) but I got the result equel to 2 x Z in the last row and last coloumn.
Is there any other (easy) trick to sum this matrices?
Thank you in advance.
Answers (0)
See Also
Categories
Find more on Matrix Indexing 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!