how to delete field in struct in loop?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sagar Dhage
le 11 Sep 2014
Réponse apportée : Andrei Bobrov
le 11 Sep 2014
In have struct A having fields A1(2x1), A2(2x1), A3(12x1) ....A100(23x1). I want to delete fields whose size is (2x1). how to delete it
0 commentaires
Réponse acceptée
Andrei Bobrov
le 11 Sep 2014
n1 = fieldnames(A);
Aout = rmfield(A,n1(cellfun(@numel,struct2cell(A)) == 2));
0 commentaires
Plus de réponses (0)
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!