Current location - Music Encyclopedia - Chinese History - What does clear mean in matlab?
What does clear mean in matlab?
Use the clear command to delete variables, as follows:

a = [ 1,3,4; 2, 2, 1];

b = sum(a, 1);

c = sum(b); % saves the 1 norm of matrix a in variable C.

Clear a b% clear matrix a and intermediate variable B.

d = b; % At this point, this statement will give an error because the variable b has been deleted and the memory space has been released.

Extended data:

Common clearing commands in MATLAB

1, clc command: You can clear the contents of the command window.

2.clf command: clear the content in the current drawing.

3. Close command: Close the currently opened graphical interface.

4. Clear command: Clear variables in the workspace.

5. Exit command: exit MATLAB, and exit the software directly after execution.

Note: 1, cleared

This command will refresh the screen, essentially just turning the display page of the terminal back one page. This command is usually used if you can still see the previous operation information by scrolling up the screen.

2. Reset

This command will completely refresh the terminal screen, and the previous terminal input operation information will be cleared and refreshed, but the whole command process is a bit slow and less used.

3. In addition, introduce a method to clear the screen by using alias, as follows:

[root @ localhost ~]$ alias cls = ' clear '

[root@localhost ~]$ cls

After executing the above command, you can directly enter the cls command to realize the same screen clearing command as clear.

Clear-Baidu Encyclopedia