How to Initialize the Workspace and Remove All Variables in MATLAB
Method
clear
Command
Typing clear in the command window will reset the workspace.
Clearing Workspace (Alt+T+O)
Right-clicking on the workspace window allows you to select ‘Clear Workspace (O)’. Pressing it resets the workspace. This can also be done using the shortcut Alt+T+O, but it does not work when an editor is opened.
Deleting by Selection
You can delete by dragging to select everything or by pressing Ctrl+a to select all and then pressing Delete.