フィルターのクリア

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