- Do your thing
- Close Matlab
- Modify the command history file history.m (delete last line). Use prefdir() to find where it is located.
- Reopen Matlab
Clear text typed with input() from the command history
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Oleg Komarov
am 10 Jun. 2014
Bearbeitet: Oleg Komarov
am 25 Nov. 2014
The case scenario is very simple, I am asking for a password to be typed in the command window.
I am using
s = input('Password: ','s')
I can clear the text from the command window with something like fprintf(char(8)), but how do I clear the last typed command from the command history ?
I am aware that inputdlg() would solve the problem but I would be interested in finding some way for editing the history.
EDIT
I personally changed approach from cmd window input to GUI input and wrote a submission for the purpose: http://uk.mathworks.com/matlabcentral/fileexchange/47210-passfield

2 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Cedric Wannaz
am 10 Jun. 2014
Bearbeitet: Cedric Wannaz
am 10 Jun. 2014
It may be a bit violent but
com.mathworks.mlservices.MLCommandHistoryServices.removeAll
would work.
And welcome back! ;-)
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!