필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to add with a Matrix

조회 수: 2 (최근 30일)
John Woods
John Woods 2020년 6월 19일
마감: MATLAB Answer Bot 2021년 8월 20일
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?

답변 (1개)

Walter Roberson
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

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by