23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

clear<br />

2clear<br />

Purpose Remove items from workspace, freeing up system memory<br />

Graphical<br />

Interface<br />

2-264<br />

As an alternative to the clear function, use Clear Workspace in the <strong>MATLAB</strong><br />

desktop Edit menu, or in the context menu in the Workspace browser.<br />

Syntax clear<br />

clear name<br />

clear name1 name2 name3 ...<br />

clear global name<br />

clear keyword<br />

clear('name1','name2','name3',...)<br />

Description clear removes all variables from the workspace. This frees up system memory.<br />

clear name removes just the M-file or MEX-file function or variable name from<br />

the workspace. You can use wildcards (*) to remove items selectively. For<br />

example, clear my* removes any variables whose names begin with the string<br />

my. It removes debugging breakpoints in M-files and reinitializes persistent<br />

variables, since the breakpoints for a function and persistent variables are<br />

cleared whenever the M-file is changed or cleared. If name is global, it is<br />

removed from the current workspace, but left accessible to any functions<br />

declaring it global. If name has been locked by mlock, it remains in memory.<br />

Use a partial path to distinguish between different overloaded versions of a<br />

function. For example, clear inline/display clears only the display method<br />

for inline objects, leaving any other implementations in memory.<br />

clear name1 name2 name3 ... removes name1, name2, and name3 from the<br />

workspace.<br />

clear global name removes the global variable name.Ifname is global, clear<br />

name removes name from the current workspace, but leaves it accessible to any<br />

functions declaring it global. Use clear global name to completely remove a<br />

global variable.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!