How to copy a structure without a field?

7 Ansichten (letzte 30 Tage)
Mr M.
Mr M. am 16 Okt. 2018
Bearbeitet: Stephen23 am 16 Okt. 2018
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?

Akzeptierte Antwort

Stephen23
Stephen23 am 16 Okt. 2018
Bearbeitet: Stephen23 am 16 Okt. 2018
Use rmfield:
q = rmfield(p,'field2')

Weitere Antworten (0)

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by