How do I add numbers in a cell to another cell?
Mostrar comentarios más antiguos
"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 comentarios
James Tursa
el 1 de Mayo de 2019
Editada: James Tursa
el 1 de Mayo de 2019
Please provide a small example of inputs and desired output so we know for sure what you are asking. Based on your wording, this is what you could do:
A{1}(3) = A{1}(3) + B{1}(2) + B{1}(4);
Austin Sowers
el 1 de Mayo de 2019
Editada: Austin Sowers
el 1 de Mayo de 2019
James Tursa
el 1 de Mayo de 2019
We are still trying to figure out the rules for your adding. What would be the desired result fot this latest example?
Austin Sowers
el 1 de Mayo de 2019
Editada: Austin Sowers
el 1 de Mayo de 2019
Austin Sowers
el 2 de Mayo de 2019
James Tursa
el 2 de Mayo de 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
el 2 de Mayo de 2019
Editada: Austin Sowers
el 2 de Mayo de 2019
Respuestas (1)
gonzalo Mier
el 1 de Mayo de 2019
A{1}(B{1}==X) = B{1}(B{1}==X)
3 comentarios
Austin Sowers
el 1 de Mayo de 2019
Austin Sowers
el 1 de Mayo de 2019
gonzalo Mier
el 1 de Mayo de 2019
Use the solution of James Tursa of the comments: https://www.mathworks.com/matlabcentral/answers/459692-how-do-i-add-numbers-in-a-cell-to-another-cell#comment_700634
Categorías
Más información sobre Big Data Processing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!