How to delete elements from a struct array?

35 次查看(过去 30 天)
I have a large struct array:
>> statsDefects.Area
ans =
25
ans =
23
...
How can I remove all numbers that are greater than 500?

采纳的回答

James Tursa
James Tursa 2018-7-20
Not exactly sure what you want to do. If you want to delete all structure elements (i.e., all fields for that element) where the area is greater than 500, then this
statsDefects([statsDefects.Area]>500) = [];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by