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?

 Akzeptierte Antwort

bio lim
bio lim am 12 Jul. 2015

2 Stimmen

a = arrayfun(@(n) s.f2 < 30, length(s.f2));
s = s(a);

Weitere Antworten (0)

Kategorien

Gefragt:

am 12 Jul. 2015

Beantwortet:

am 12 Jul. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by