필터 지우기
필터 지우기

how to use the kbhit function to poll for keypress

조회 수: 11 (최근 30일)
genesis
genesis 2013년 10월 23일
댓글: genesis 2013년 10월 23일
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.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 10월 23일
When there is no key in the buffer, kbhit will return [] as the key.
  댓글 수: 1
genesis
genesis 2013년 10월 23일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by