How to add a large number of cell.
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Abhishek mani Shukla
le 27 Août 2018
Commenté : Amir Xz
le 27 Août 2018
i have 3000 cell and each cell have size of 4*10^5.I want to add all cell in a single array of order (1,12*10^8).
0 commentaires
Réponse acceptée
Plus de réponses (1)
KSSV
le 27 Août 2018
Read about cell2mat and _sum)
A{1} = rand(2,1) ;
A{2} = rand(2,1) ;
A{3} = rand(2,1) ;
B = cell2mat(A) ;
sum(B)
You can achieve the above in many ways. Like using loop or cellfun.
2 commentaires
Amir Xz
le 27 Août 2018
If you use default class (double), so you need 8.94 GB memory!
64*(12*10^8)/(8*2^30) = 8.9407 GB
So, change the class if that's OK.
Use the same name for your variables and ...
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!