How to delete the columns in a structure array

26 views (last 30 days)
I have a structure array HT (1 x 50000) with 20 fields. I want to delete the columns whose size is less than 10.
Tomer on 27 Feb 2020
All fields have same length, I want to delete that particular column whose field length is less than 10.

Sign in to comment.

Accepted Answer

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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by