I want to make that makes graph move with a direction keyboard.

6 ビュー (過去 30 日間)
지환
지환 2025 年 5 月 9 日
回答済み: Walter Roberson 2025 年 5 月 9 日
Every time a graph presses an arrow key, it wants to move in that direction. Like a game character. how can i do that? plz help me

回答 (1 件)

Walter Roberson
Walter Roberson 2025 年 5 月 9 日
The easiest way is to have a figure, and attach a KeyPressFcn property to the figure; https://www.mathworks.com/help/matlab/ref/matlab.ui.figure-properties.html#buiwuyk-1-KeyPressFcn
If you happened to have the situation where you did not have any figure but you wanted some reaction in response to key presses, then the situation would be more difficult, and would require using third-party functions.

カテゴリ

Help Center および File ExchangeJust for fun についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by