Effacer les filtres
Effacer les filtres

How to delete elements from a struct array?

39 vues (au cours des 30 derniers jours)
Asher Zaidi
Asher Zaidi le 20 Juil 2018
Commenté : Asher Zaidi le 20 Juil 2018
I have a large struct array:
>> statsDefects.Area
ans =
25
ans =
23
...
How can I remove all numbers that are greater than 500?

Réponse acceptée

James Tursa
James Tursa le 20 Juil 2018
Not exactly sure what you want to do. If you want to delete all structure elements (i.e., all fields for that element) where the area is greater than 500, then this
statsDefects([statsDefects.Area]>500) = [];
  1 commentaire
Asher Zaidi
Asher Zaidi le 20 Juil 2018
Yes, that's exactly what I wanted! Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by