I have a workspace with lots of objects and I would like to remove all but one. Ideally I would like to avoid having to type rm(obj.1, obj.2... obj.n). Is it possible to indicate remove all objects but these ones?
I have a workspace with lots of objects and I would like to remove
Share
Here is a simple construct that will do it, by using
setdiff:And a full example. Run this at your own risk – it will remove all variables except
x: