How to filter field data in structure?

조회 수: 8 (최근 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 CenterFile Exchange에서 Floating-Point to Fixed-Point Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by