How to filter field data in structure?

4 visualizzazioni (ultimi 30 giorni)
John Rivers
John Rivers il 12 Lug 2015
Risposto: bio lim il 12 Lug 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?

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Floating-Point to Fixed-Point Conversion in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by