how can I add a value to a particular cell in an array.

10 ビュー (過去 30 日間)
Bashir Yusuf Bichi
Bashir Yusuf Bichi 2017 年 11 月 6 日
回答済み: KL 2017 年 11 月 6 日
if [3,2,4,5;3,2,6,4;2,5,8,5] is array then we add we add 2 to the second row to become [2,3,2,5;3, 4,6,4;2,5,8,5]
  1 件のコメント
Star Strider
Star Strider 2017 年 11 月 6 日
Your examples do not match what you state you want to do.

サインインしてコメントする。

採用された回答

KL
KL 2017 年 11 月 6 日
if A is your array,
>> A = [3,2,4,5;3,2,6,4;2,5,8,5]
A =
3 2 4 5
3 2 6 4
2 5 8 5
and if you want to add 2 to 2nd row, 2nd column,
A(2,2) = A(2,2)+2;
and then A becomes,
A =
3 2 4 5
3 4 6 4
2 5 8 5
is this what you mean?

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by