To delete a variable within a structure in MATLAB, you can use the rmfield
function like this:
main.m43 chars2 lines
where myStruct
is the name of your structure and 'fieldName'
is the name of the field you want to remove. This function returns the modified structure with the named field removed from it. For example:
main.m119 chars7 lines
This will remove the bar
variable from the myStruct
structure and leave only the foo
variable.
gistlibby LogSnag