Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to add with a Matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a 1x276 matrix that I want to add 1 to each element but each time I do, my matrix turns to all ones. So for example lets say A=[32 45 96] and I want to make it B=[33 46 97] how do I do that?
댓글 수: 0
답변 (1개)
Walter Roberson
2020년 6월 19일
편집: Walter Roberson
2020년 6월 19일
B = A + 1
or
B = A;
for idx = 1 : numel(B)
B(idx) = B(idx) + 1;
end
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!