Clearing a structure variable

25 ビュー (過去 30 日間)
George
George 2011 年 9 月 9 日
Hello
If I have the following structure:
a.h1 = 800; a.caseid = 'HM';
How do I clear a.h1?
Thanks

採用された回答

Andrei Bobrov
Andrei Bobrov 2011 年 9 月 9 日
a.h1 = 800; a.caseid = 'HM';
clear a.h1
a.h1 = []
remove field 'h1'
rmfield(a,'h1')

その他の回答 (1 件)

George
George 2011 年 9 月 9 日
Thanks Andrei! I wasn't aware of the rmfield function.
George

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by