How to filter field data in structure?

3 ビュー (過去 30 日間)
John Rivers
John Rivers 2015 年 7 月 12 日
回答済み: bio lim 2015 年 7 月 12 日
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?

採用された回答

bio lim
bio lim 2015 年 7 月 12 日
a = arrayfun(@(n) s.f2 < 30, length(s.f2));
s = s(a);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssembly についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by