フィルターのクリア

How to use the mouse scroll as a counter in MATLAB?

2 ビュー (過去 30 日間)
Rudy
Rudy 2015 年 6 月 12 日
コメント済み: Walter Roberson 2015 年 6 月 16 日
Hi there,
I want to use the scroll wheel in a figure. What I for instance want: Take the function f(x) = x^a, where 'x' is something like 1:10 and 'a' a constant. I want to plot f(x), and when I scroll up I want 'a' to increase by one, and when I scroll down I want 'a' to decrease by one and display it right away. Is this possible?
Thank you for your help in advance.
Kind regards, Rudy

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 6 月 12 日
  2 件のコメント
Rudy
Rudy 2015 年 6 月 16 日
Some explanation would be nice.
Walter Roberson
Walter Roberson 2015 年 6 月 16 日
Set a WindowScrollWheelFcn callback on the figure; see http://www.mathworks.com/help/matlab/ref/figure-properties.html for more information on the Event structure that is passed to it.
Your callback would calculate a new value for "a" and then would call a function to do the plotting for you.

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

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by