4.0

4.0 | 1 rating Rate this file 189 downloads (last 30 days) File Size: 3.01 KB File ID: #3967

gcoll: a pedestrian garbage collector and workspace cleaner

by us

 

16 Sep 2003 (Updated 01 Oct 2003)

Code covered by BSD License  

garbage-collects workspace variables into a structure and optionally deletes those floating variable

Download Now | Watch this File

File Information
Description

this little routine is a garbage collector that helps to clean up a messy workspace.

it collects those numerous variables (or selected members of them) either from the base's or caller's workspace into a handy structure, where each fieldname represents a variable with its contents set to the variable's value.

optionally, it will remove the variable after(!) assignment -or- keep only those that are selected.

when called within a function with the option
s=gcoll('-caller');
it collects all current variables used within that function; other options and/or patterns apply.

look at the accompanying image and type
help gcoll
at the command prompt for more insights.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
18 Sep 2003 Urs Schwarz (us)

please note: there is an update in the pipeline that gets rid of a small typo, adds a new output-formatting style (user request), and updates the thumbnail. it's version_tag is 18-Sep-2003 16:38:20.
min, please remove this pseudo-review after the file got updated.
thanks a bunch in advance, us

02 Nov 2007 yasser essiarab

simple but working properly.. I have less out of memory. it should be used with smart preallocation. increase global performance.
a better tutorial might be usefull

Please login to add a comment or rating.
Updates
19 Sep 2003

changed output formatting, removed a tiny bug.
ver_tag: 18-Sep-2003 16:38:20

19 Sep 2003

update image to represent current formatting

22 Sep 2003

added size info to output. ver_tag: 21-Sep-2003 02:49:07

30 Sep 2003

simplified input: all options/workspace_id now can be specified as part of the command string by a leading dash, eg, gcoll('a* -base b* -x'). ver_tag: 30-Sep-2003 09:18:19

01 Oct 2003

added new flag -k (keep). gcoll a* b* -k will remove all variables from specified workspace except those selected. ver_tag: 01-Oct-2003 11:37:26

01 Oct 2003

str matching engine will not reject variations of forbidden tags (global,-file) anymore. ver_tag: 01-Oct-2003 17:55:17

Tag Activity for this File
Tag Applied By Date/Time
garbage us 22 Oct 2008 07:07:42
waste us 22 Oct 2008 07:07:42
clean us 22 Oct 2008 07:07:42
keep us 22 Oct 2008 07:07:42
memory us 22 Oct 2008 07:07:42
workspace us 22 Oct 2008 07:07:42
variable us 22 Oct 2008 07:07:42
structure us 22 Oct 2008 07:07:42
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com