フィルターのクリア

GUI dynamic output

1 回表示 (過去 30 日間)
ANUBHAV SINHA
ANUBHAV SINHA 2011 年 11 月 7 日
I want to construct a standalone GUI in which, as the user slides an input slider, a ‘dot’ moves on the screen of the GUI according to some algorithm. May someone suggest about how to realize this.
  1 件のコメント
Walter Roberson
Walter Roberson 2011 年 11 月 7 日
Closely related question by the same author: http://www.mathworks.com/matlabcentral/answers/20563-gui-dynamic-interface

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

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 11 月 7 日
In the callback function for the slider, get() the Value associated with the slider, pass that to a routine that calculates the desired new position, and set() the XData and YData properties of the dot to be the new desired position.
  3 件のコメント
ANUBHAV SINHA
ANUBHAV SINHA 2011 年 11 月 7 日
does MATLAB GUI provides shapes (such as dot or arrow) in its library to be used?
Walter Roberson
Walter Roberson 2011 年 11 月 7 日
See your other question for information about arrows.
If you are already using annotation() to draw an arrow, you might as well use annotation() to draw an ellipse as well: an ellipse with equal height and width would be a circle. You would then move and resize the circle by changing the annotation ellipse Position property.
http://www.mathworks.com/help/techdoc/ref/annotationellipseproperties.html
Another way of drawing a circle is to use the rectangle() function: despite its name it will draw circles (or ellipses) too. The Position property would be the one to manipulate for it.
You can also just plot a point and use 'o' as the marker shape and define your MarkerSize to be as large as you want the dot to be. You would move it by changing the line XData and YData properties.
Other ways of drawing a circle are described at http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F
You could move the image of a dot around on the screen if you really wanted.

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

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by