how to sum elements of a cell array

16 visualizaciones (últimos 30 días)
mohamed Faraj
mohamed Faraj el 14 de Ag. de 2019
Respondida: madhan ravi el 14 de Ag. de 2019
I have a cell array V={[1;2;3;4],[5;6;7;8]}, I want to do a summation as follows [1+5;2+6;3+7;4+8]. I need the result to be in a matrix. Thank you

Respuesta aceptada

madhan ravi
madhan ravi el 14 de Ag. de 2019
sum(cat(3,V{:}),3)

Más respuestas (0)

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by