'How do you clear the console in MATLAB?

How do you clear the console in MATLAB?

For example, I'm debugging a script that displays a ton of output. I want to clear the console on every run, so I don't have to look through output from old runs.



Solution 1:[1]

>> clc %clear command

Related functions include:

>> clf %clear figure
>> cla %clear axis
>> close all %close all windows
>> clear %clear workspace of variables

Solution 2:[2]

One more option to achieve the clc is to right-clicking in the command window and choosing 'Clear command window'

Solution 3:[3]

There is also a default shortcut for clearing command window, which is CTRL+L. That's probably the fastest way to clear the output.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MatlabDoug
Solution 2 Jonas Malm
Solution 3 Micer