How do you delete and space characters in Matlab Virtual Keyboard ?

15 visualizaciones (últimos 30 días)
Jeremy Tsang
Jeremy Tsang el 15 de Mzo. de 2021
Comentada: Uday Pradhan el 22 de Mzo. de 2021
We are having trouble deleting and spacing characters in our Matlab virtual keyboard. When we want to press delete, the word delete appears in the keyboard instead of actually deleting characters. When we want to space out the characters in Matlab, the word space appears in the matlab code instead of actually spacing out the characters.

Respuestas (1)

Uday Pradhan
Uday Pradhan el 19 de Mzo. de 2021
Editada: Uday Pradhan el 19 de Mzo. de 2021
Just a naive try at what you asked, i hope it helps!
function AddLetter(letter)
%Called when letter pressed
%Add letter to string
str = get(hEdit,'string');
if strcmp(letter,'SPACE')
str(end+1) = ' ';
elseif strcmp(letter,'DELETE')
str(end) = '';
str = horzcat(str,letter);
%NOTE: Obviously, you'll need to add features here such as
%backspace etc.
  2 comentarios
Uday Pradhan
Uday Pradhan el 22 de Mzo. de 2021
On my end, It works like a backspace key. I have just used the following logic:
>> str = 'hello world';
>> str(end) = '' %empty quote
str =
'hello worl'

Iniciar sesión para comentar.


Más información sobre Desktop en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by