How to delete the columns in a structure array

10 次查看(过去 30 天)
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