How do I delete an element from a structure?

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...

 Accepted Answer

Mischa Kim
Mischa Kim on 29 May 2014
Edited: Mischa Kim on 29 May 2014
Douglas, use rmfield:
k = rmfield(k,'options');

1 Comment

ohh Perfect!! I didn't know that. Thank you a lot Mischa!

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!