Adding cell array entries
Mostrar comentarios más antiguos
Suppose you have a 162*24 cell array called CC and each cell array entry consist of a matrix.
How would you add CC{1,1}+CC{2,1}+CC {3,1}.....CC{162,1}
and then to the same for the remaining 23 columns.
I dont need the sum but all matrices within each cell entry have to be added.
Thanks
Respuesta aceptada
Más respuestas (1)
Sara Boznik
el 23 de Ag. de 2020
for i=1:24
sol=sum((CC(:,i)))
end
1 comentario
Walter Roberson
el 23 de Ag. de 2020
No, not for a cell array. sum() does not apply to cell arrays.
Also, you are overwriting all of sol each iteration.
Categorías
Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!