Filter löschen
Filter löschen

how to use the kbhit function to poll for keypress

11 Ansichten (letzte 30 Tage)
genesis
genesis am 23 Okt. 2013
Kommentiert: genesis am 23 Okt. 2013
i came across this function khbit by Amanda but i cant figure out how to use it. i initialize the function and press a key but it did not register anything at all. anyone with any idea how this function work?
what im trying to do is to see if the user press a key eg: Enter during program execution. if the particular key is pressed, the program should perform other task.

Antworten (1)

Walter Roberson
Walter Roberson am 23 Okt. 2013
When there is no key in the buffer, kbhit will return [] as the key.
  1 Kommentar
genesis
genesis am 23 Okt. 2013
ok i figured out how it works but now i have this error everytime i run the code. Maximum recursion limit of 1000 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer. i tried changing the limit from 500 to 1000 but still doesnt work.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Indexing 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!

Translated by