Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Adding matrices, resulting matrix is only a copy of one of the matrices being added
조회 수: 1 (최근 30일)
이전 댓글 표시
I am attempting to add three matrices although when I do so, the resulting matrix is the same as one of the matrices being added rather than a combination of the three.
For example, if I am trying to add matrices A, B and C, when I add them, the contents of the resulting matrix are the same as A alone.
What is a possible explanation for this?
댓글 수: 0
답변 (2개)
Wayne King
2012년 10월 14일
편집: Wayne King
2012년 10월 14일
Are these large matrices? Can you show us? Of course it is possible that
A = A+B+C
but that means that B+C must necessarily be the additive identity (matrix of zeros)
For example:
A = randi([-5 5],10,10);
B = randi([-3 3],10,10);
C = -B;
A+B+C
댓글 수: 1
Walter Roberson
2012년 10월 14일
This could happen if the values in B and C were much smaller than the values in A. For example, [1] + [1e-30] + [1e-50] is going to be [1]
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!