The Clear Command

The clear command removes all variables from the Matlab workspace.

The Clear Command

Variables typed into the command line stay around as long as Matlab does, but you can clear them by using the 'clear' command in Matlab.

Note: Often between running programs you will want to "clear" all the old variables, so that your new program doesn't accidentally use some of the old "data".

Note: A well written program will "initialize" every variable and thus this wouldn't be a problem.



Back to Topics List