How to copy a structure without a field?

16 次查看(过去 30 天)
I have p with field1, filed2, filed3 (p(1).field1, p(2).filed1, p(1).filed2, etc.). I want to make a copy: q = p, but copy only filed1 and filed3 for example. How to do that?

采纳的回答

Stephen23
Stephen23 2018-10-16
编辑:Stephen23 2018-10-16
Use rmfield:
q = rmfield(p,'field2')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by