sum values in a cell array
Afficher commentaires plus anciens
Hello! I have
a={0.006;0.45;0.1;0.23;0.12}
and I want to sum all the values in a, how can i do?
Réponse acceptée
Plus de réponses (1)
BINGXIN YAN
le 12 Juil 2021
3 votes
What if the cell is more complicated?
I have a{1,1}=[1,1];a{1,2}=[0,1];a{1,3}=[2,5],
and I want to sum all the values in a{1,:}(1), for example
a{1,1}(1)+a{1,2}(1)+a{1,3}(1)=1+0+2, how can I do except restoring a{1,:}(1) in another matrix or array.
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!