Azzera filtri
Azzera filtri

How to sum up numbers into a cell?

1 visualizzazione (ultimi 30 giorni)
ARGY B
ARGY B il 7 Mag 2019
Commentato: ARGY B il 7 Mag 2019
Hi, I have a 100x5 cell, and each element of it contains vectors of different sizes. See pic1.
The vectors contains different numbers (pic 2). So, is it possible to sum up these numbers, so the final result would be a matrix 100x5?
I know that probably this can be done with a for loop. But is there any other solution?

Risposta accettata

Alex Mcaulley
Alex Mcaulley il 7 Mag 2019
If a is your cell array:
b = cellfun(@sum,a)

Più risposte (0)

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by