How do I clear the command history from the command line in MATLAB?
56 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 27 Jun. 2009
Kommentiert: Walter Roberson
am 16 Mai 2020
I would like to clear the command history from the command line in MATLAB.
Akzeptierte Antwort
MathWorks Support Team
am 27 Jun. 2009
In MATLAB 7.0 (R14), the following command will clear the Command History:
com.mathworks.mlservices.MLCommandHistoryServices.removeAll;
In MATLAB 6.5 (R13), use the following command:
com.mathworks.ide.cmdline.CommandHistory.deleteAllHistoryForDesktop;
Please note that the use of these commands is not supported, and they may change in a future release.
1 Kommentar
Jacob Lynch August
am 21 Mär. 2019
This is really useful, since I often have to input a password to read an encrypted file. Is there a way to just delete only the previous line from the command history?
Looking at the methods of MLCommandHistoryServices, I see there are add, getAllHistory, getSessionHistory, and removeAll. It looks like I could get all history, remove all history, then iteratively add each element, shy of the last one to accomplish this, but I'm hoping there is a smarter option.
Weitere Antworten (1)
drummer
am 10 Jul. 2018
just type clc . It will clear your history window in matlab. If you want to clear the data as well, type: clc, clear
2 Kommentare
Jacob Lynch August
am 21 Mär. 2019
That's not useful if you're calling a function that takes a secret phrase for input, e.g. opening an encrypted file.
Siehe auch
Kategorien
Mehr zu Function Creation finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!