MATLAB: How to delete n element from structure structures How an element can be deleted from a structure. Structure is having only one field. Best Answer % Make a structure with one field% and an array in that field.s.field1 = [1,2,3,4,5];% Delete element 4 from the array in field1s.field1(4) = [] Related SolutionsMATLAB: Array of structures in matlab array1=1:10array2=21:30out=struct('field1', num2cell(array1),'field2',num2cell(array2)) MATLAB: How to delete elements from structure Deleting an element of a structure is easy, and it has nothing to do with fields:S.population(1).type = 1;S.population(2).type = 2;S.population(1).profile = [1 1 2];S.population(2).profile = [2 1 2];S.population(1) = [] % delete the first element of S.population Related QuestionSimple operations with structArray of structures containing arraysArray of structures in matlabHow to delete a field from a structQuestion about structures in Matlab
Best Answer