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

조회 수: 2 (최근 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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by