How to filter field data in structure?

10 vues (au cours des 30 derniers jours)
John Rivers
John Rivers le 12 Juil 2015
Réponse apportée : bio lim le 12 Juil 2015
Hello. This is my first question. If my structure s has 3 fields f1 f2 f3. I want to filter f2 so that its value is less than 30. How to do that?

Réponse acceptée

bio lim
bio lim le 12 Juil 2015
a = arrayfun(@(n) s.f2 < 30, length(s.f2));
s = s(a);

Plus de réponses (0)

Catégories

En savoir plus sur Floating-Point to Fixed-Point Conversion 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!

Translated by