How do I delete an element from a structure?

1 Ansicht (letzte 30 Tage)
Douglas Alves
Douglas Alves am 29 Mai 2014
Kommentiert: Douglas Alves am 29 Mai 2014
I have this
k.range = [-pi/4 pi/2] ;
k.init = sqrt(2)/2 ;
k.options = odeset('Events',@mystopper);
suppose I want to delete k.options how do I do it?
I found nothing in doc structure...

Akzeptierte Antwort

Mischa Kim
Mischa Kim am 29 Mai 2014
Bearbeitet: Mischa Kim am 29 Mai 2014
Douglas, use rmfield:
k = rmfield(k,'options');
  1 Kommentar
Douglas Alves
Douglas Alves am 29 Mai 2014
ohh Perfect!! I didn't know that. Thank you a lot Mischa!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by