How do I clear the command history from the command line in MATLAB?
조회 수: 56 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2009년 6월 27일
댓글: Walter Roberson
2020년 5월 16일
I would like to clear the command history from the command line in MATLAB.
채택된 답변
MathWorks Support Team
2009년 6월 27일
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
Jacob Lynch August
2019년 3월 21일
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.
추가 답변 (1개)
drummer
2018년 7월 10일
just type clc . It will clear your history window in matlab. If you want to clear the data as well, type: clc, clear
댓글 수: 2
Jacob Lynch August
2019년 3월 21일
That's not useful if you're calling a function that takes a secret phrase for input, e.g. opening an encrypted file.
참고 항목
카테고리
Help Center 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!