How to delete the columns in a structure array

조회 수: 10 (최근 30일)
Tomer
Tomer 2020년 2월 27일
편집: SS 2020년 2월 27일
Hi.
I have a structure array HT (1 x 50000) with 20 fields. I want to delete the columns whose size is less than 10.
  댓글 수: 2
Stephen23
Stephen23 2020년 2월 27일
"I have a structure array HT (1 x 50000) with 20 fields. I want to delete the columns whose size is less than 10."
Your structure only has one row, so it is not clear what "...size less than 10" refers to.
Tomer
Tomer 2020년 2월 27일
All fields have same length, I want to delete that particular column whose field length is less than 10.

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

채택된 답변

SS
SS 2020년 2월 27일
편집: SS 2020년 2월 27일
A similar question was asked by me in the past.
HT(any(cellfun(@numel,struct2cell(HT)) < 10)) = []

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by