clearing screen and workspace matlab

1. clc (clearing Screen)

clc command will clear screen in Matlab.

>> clc

This will clear the screen only without clearing workspace, all initialized variables will remain stored.

2. clear all (clearing all workspace variables)

clear all command is used to clear all workspace variable. used as :

>> clear all

3. clearing single variable with clear

clear all will delete all workspace variables and data but, if you want to delete the value for single variable, you may use it as :

>> b = 2563

b =


>> clear b % only b will be deleted without removing all elements