| MATLAB Functions | Help Desk |
clear
Remove items from memory
clear clearnameclearname1name2name3clear globalname
clear |
|
functions
|
clear,
by itself, clears all variables from the workspace.
clear name
removes just the M-file or MEX-file function or variable name from the workspace. If name is global, it is removed from the current workspace, but left accessible to any functions declaring it global.
clear name1 name2 name3
removes name1, name2, and name3 from the workspace.
clear global name
removes the global variable name.
clear keyword
clears the indicated items:Removes all variables, functions, and MEX-files from memory, leaving the workspace empty. |
clear my* removes any variables whose names begin with the string "my." The function form of the syntax, clear('name'), is also permitted.
clear doesn't affect the amount of memory allocated to the MATLAB process under UNIX.
pack Consolidate workspace memory