MATLAB: Delete empty field – rows in a structure delete rows from structure I have a structure which has some empty field – rows. How can, I delete these empty them from the structure? Best Answer Added as an answer since it seemed to solve the problem.Track_20( all( cell2mat( arrayfun( @(x) structfun( @isempty, x ), Track_20, 'UniformOutput', false ) ), 1 ) ) = [];would work, I think, though it looks ghastly. I'm sure there is probably a simpler way! Related SolutionsMATLAB: Check if any field in a given structure is empty any( structfun(@isempty, YourStructure) ) MATLAB: Cell Array to Structures http://www.mathworks.com/help/matlab/ref/cell2struct.htmlNote: this will use struct() internally. Related QuestionVertical concatenation of structure fieldsHow to conbine the array inside the structureGet rid of NaNs
Best Answer