필터 지우기
필터 지우기

How to delete elements from a struct array?

조회 수: 35 (최근 30일)
Asher Zaidi
Asher Zaidi 2018년 7월 20일
댓글: Asher Zaidi 2018년 7월 20일
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) = [];
  댓글 수: 1
Asher Zaidi
Asher Zaidi 2018년 7월 20일
Yes, that's exactly what I wanted! Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (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