How to filter field data in structure?

3 次查看(过去 30 天)
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 中查找有关 Assembly 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by