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

3 Ansichten (letzte 30 Tage)
Austin Sowers
Austin Sowers am 1 Mai 2019
Bearbeitet: Austin Sowers am 2 Mai 2019
"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 Kommentare
James Tursa
James Tursa am 2 Mai 2019
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 am 2 Mai 2019
Bearbeitet: Austin Sowers am 2 Mai 2019
Good question. I will be ignoring the ones on the end for this reason.
and yes. that is correct. exactly

Melden Sie sich an, um zu kommentieren.

Antworten (1)

gonzalo Mier
gonzalo Mier am 1 Mai 2019
A{1}(B{1}==X) = B{1}(B{1}==X)
  3 Kommentare
Austin Sowers
Austin Sowers am 1 Mai 2019
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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by