MATLAB: How to delete a field from a struct

MATLABprogrammingrmfieldstruct

I used "rmfield" to try to delete a field from a struct, but the struct appears the same. How can I modify the struct?

Best Answer

Make sure to assign the revised struct back to the original variable. For instance, to remove field "field" from "s", use:
>> s = rmfield(s,field)
For more information, see the below documentation reference:
Related Question