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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

clear<br />

Remarks When you use clear in a function, it has the following effect on items in your<br />

function and base workspaces:<br />

2-266<br />

• clear name -Ifname is the name of a function, the function is cleared in both<br />

the function workspace and in your base workspace.<br />

• clear functions - All functions are cleared in both the function workspace<br />

and in your base workspace.<br />

• clear global - All global variables are cleared in both the function<br />

workspace and in your base workspace.<br />

• clear all - All functions, global variables, and classes are cleared in both<br />

the function workspace and in your base workspace.<br />

Limitations clear does not affect the amount of memory allocated to the <strong>MATLAB</strong> process<br />

under UNIX.<br />

Examples Given a workspace containing the following variables<br />

Name Size Bytes Class<br />

c 3x4 1200 cell array<br />

frame 1x1 java.awt.Frame<br />

gbl1 1x1 8 double array (global)<br />

gbl2 1x1 8 double array (global)<br />

xint 1x1 1 int8 array<br />

You can clear a single variable, xint, by typing<br />

clear xint<br />

To clear all global variables, type<br />

clear global<br />

whos<br />

Name Size Bytes Class<br />

c 3x4 1200 cell array<br />

frame 1x1 java.awt.Frame

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

Saved successfully!

Ooh no, something went wrong!