GetEchoString Loop Rewrite

Hi all,

I am running MatLab r2021a on a windows PC. I am using PTB to make essentially an input area for digits listened to. So the user hears a stimulus, types x digits, then presses enter to submit and then moves onto the next stimulus without closing the screen. I am doing this with the use of GetEchoString I made, and right now everything is working as expected except for I cannot seem to figure out how to clear the input area after the enter key is submitted. Currently it will just write over itself, for instance if my first submission was 00000 it would appear as 10000, 12000, 12300, 12340, 12345 as I press in the next numerical values. I was hoping to have it completely clear. But I cannot seem to figure out how to get it to work. I have a hunch it has something to do with the screen flip function and the way the text is written, being machine code-esque, but I was wondering if anyone had any advice on how to advance.

My implementation at the current moment was just using it in a standard for loop after initializing the window.

Thank you so much for the help,
Alex Clonan

I do not understand your problem. Do you mean that if you call GetEchoString a second time, then the previously typed string is still visible? If so, then just do a Screen(‘Flip’) after the first GetEchoString to clean up the screen again