フィルターのクリア

Using arrow keys to change value

3 ビュー (過去 30 日間)
empy
empy 2015 年 6 月 29 日
編集済み: Joseph Cheng 2015 年 7 月 1 日
Hi, I have a simple question for using the arrow keys.
How can I use the arrow keys to add values to a defined variable?
For example if i have defined;
xpos = 20
ypos = 20
Then I want to use arrowkeys "left" to put xpos = xpos - 1
and arrowkey "up" to put ypos = ypos + 1 for example.
Where should I define the values of xpos and ypos.
  1 件のコメント
Joseph Cheng
Joseph Cheng 2015 年 7 月 1 日
編集済み: Joseph Cheng 2015 年 7 月 1 日
The main question here is are you talking about incrementing/decrementing xpos and ypos during a run of a script/gui? OR have it as a shortcut when typing in the editor?

サインインしてコメントする。

回答 (1 件)

Adam Hug
Adam Hug 2015 年 7 月 1 日
There is no way to do this in MATLAB without writing a UI. You can come close to this behavior by doing xpos = xpos + 1 in the Command Window and then hitting the "arrowup" key to go to the previously typed command. You will then need to hit the "Enter" key to execute the command again.

カテゴリ

Help Center および File ExchangePattern Recognition and Classification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by