delete rows from a structure in matlab

To delete one or multiple rows in a struct, you can use the rmfield function. Here is an example of how to remove the 2nd row in a struct:

main.m
myStruct(2) = []; % Remove the 2nd element from the struct
59 chars
2 lines

If you need to remove a specific field from a struct, here is an example:

main.m
myStruct = rmfield(myStruct, 'fieldName'); % Remove field 'fieldName' from the struct
86 chars
2 lines

related categories

gistlibby LogSnag