| Contents | Index |
recycle
stat = recycle
previousStat = recycle state
previousStat = recycle('state')
recycle displays the current state, on or off, for recycling files you remove using the delete function. When the value is on, deleted files move to a different location. The location varies by platform—see Deleting Files and Folders Using Functions. When the value is off, the delete function permanently removes the files. For details, see the Tips section.
stat = recycle returns the current state for recycling files to the character array stat.
previousStat = recycle state sets the recycle option for MATLAB to the specified state, either on or off. The previousStat value is the recycle state before running the statement.
previousStat = recycle('state') is the function form of the syntax.
The preference for Deleting files sets the state of the recycle function at startup. When you change the preference, it changes the state of recycle. When you change the state of recycle, it does not change the preference. Use recycle to override the behavior of the preference. For example, regardless of the setting for the Deleting files preference, to remove thisfile.m permanently, run:
recycle('off')
delete('thisfile.m')
After setting the recycle state to off, all files you delete using the delete function are deleted permanently until you do one of the following:
Run recycle('on')
Restart MATLAB. Upon startup, MATLAB sets the state for recycle to match the Deleting files preference.
Start from a state where file recycling is off. Verify the current recycle state:
recycle ans = off
Turn file recycling on. Delete a file and move it to the recycle bin or temporary folder:
recycle on; delete myfile.txt

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |