MATLAB: How to delete the columns in a structure array how to delete the columns in a structure array 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. Best Answer A similar question was asked by me in the past.https://www.mathworks.com/matlabcentral/answers/493440-delete-end-points-from-columns-in-a-structure-arrayHT(any(cellfun(@numel,struct2cell(HT)) < 10)) = [] Related SolutionsMATLAB: How to delete field in struct in loop n1 = fieldnames(A);Aout = rmfield(A,n1(cellfun(@numel,struct2cell(A)) == 2)); MATLAB: Delete end points from columns in a structure array S = cell2struct(cellfun(@(x)x(3:end-2),struct2cell(S),'un',0),fieldnames(S)); Related QuestionDelete a struct in a struct arrayHow to remove empty struct fields [ ] from a group a struct fieldsHow to delete particular row from struct arrayHow to get the min/max value of all fields in a stuctureHow to access the nth element of all the arrays in a structure of arraysArray of structures in matlabGet structure elements across fieldsTo delete the empty fields in the dataset
Best Answer