How do I add numbers in a cell to another cell?

1 回表示 (過去 30 日間)
Austin Sowers
Austin Sowers 2019 年 5 月 1 日
編集済み: Austin Sowers 2019 年 5 月 2 日
"R" = random number
A = {[R R X R]}
B = {[R X R X]}
How do I add the X's in cell "B" to the X in cell "A?"
  7 件のコメント
James Tursa
James Tursa 2019 年 5 月 2 日
So it appears that when you encounter a -10 in CA, you want to add the two immediate neighboring numbers from CB to it. Correct? What if the -10 is on an edge/end?
Austin Sowers
Austin Sowers 2019 年 5 月 2 日
編集済み: Austin Sowers 2019 年 5 月 2 日
Good question. I will be ignoring the ones on the end for this reason.
and yes. that is correct. exactly

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

回答 (1 件)

gonzalo Mier
gonzalo Mier 2019 年 5 月 1 日
A{1}(B{1}==X) = B{1}(B{1}==X)
  3 件のコメント
Austin Sowers
Austin Sowers 2019 年 5 月 1 日
Using a numeric example:
A = {[2 3 7 1}]
B = {[1 7 9 3}]
Id want to add 7 and 3 in B to the 7 in A
gonzalo Mier
gonzalo Mier 2019 年 5 月 1 日

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

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by