How to delete the columns in a structure array

10 Ansichten (letzte 30 Tage)
Tomer
Tomer am 27 Feb. 2020
Bearbeitet: SS am 27 Feb. 2020
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 Kommentare
Stephen23
Stephen23 am 27 Feb. 2020
"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 am 27 Feb. 2020
All fields have same length, I want to delete that particular column whose field length is less than 10.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

SS
SS am 27 Feb. 2020
Bearbeitet: SS am 27 Feb. 2020
A similar question was asked by me in the past.
HT(any(cellfun(@numel,struct2cell(HT)) < 10)) = []

Weitere Antworten (0)

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by