I have a very large structure array in matlab. Suppose, for argument's sake, to simplify the situation, I have something like:
structure(1).name = 'a';
structure(2).name = 'b';
structure(3).name = 'c';
structure(1).returns = 1;
structure(2).returns = 2;
structure(3).returns = 3;
Now suppose I have some condition that comes along and makes me want to delete everything from structure(2)
(any and all entries in my structure array). What is a good way to do that?
My solution has been to just set the corresponding fields to []
(e.g. structure(1).name = [];
), but that doesn't remove them, that only makes them empty. How do I actually remove them completely from the structure array? Is there a way?