MATLAB: Clearing a structure variable

clearstructures

Hello
If I have the following structure:
a.h1 = 800; a.caseid = 'HM';
How do I clear a.h1?
Thanks

Best Answer

a.h1 = 800; a.caseid = 'HM';
clear a.h1
a.h1 = []
remove field 'h1'
rmfield(a,'h1')