Anyway to Pre-allocate Memory for Struct
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Is there anyway to pre-allocate memory for a struct?
I have a
1x2 struct with 2 fields.
>> s = struct('Name',0,'Name2',0)
But, it comes up as a 1x1 struct.
0 commentaires
Réponses (3)
Walter Roberson
le 17 Juil 2015
s = struct('Name',{0,0},'Name2',{0,0});
That is, use a cell array, one entry per struct member.
0 commentaires
Voir également
Catégories
En savoir plus sur Structures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!