GUI dynamic interface

I want to construct a standalone GUI on which, as the user slides a slider, the length and direction of an arrow changes according to some desired algorithm. Can someone suggest about how I may accomplish this.

1 comentario

Walter Roberson
Walter Roberson el 7 de Nov. de 2011
Closely related question by the same author: http://www.mathworks.com/matlabcentral/answers/20564-gui-dynamic-output

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 7 de Nov. de 2011

0 votos

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 X and Y properties of the annotation arrow to be the new desired start and end positions.

3 comentarios

ANUBHAV SINHA
ANUBHAV SINHA el 7 de Nov. de 2011
Thanks for your answer...but how do I get the 'arrow'? do i use the image of the arrow to change its size? how do i define the 'start position' of the arrow if its a mere image?
does MATLAB GUI provides shapes in its library to be used?
Walter Roberson
Walter Roberson el 7 de Nov. de 2011
http://www.mathworks.com/help/techdoc/ref/annotation.html
annotation() allows an arrow to be created with a given start and end point.
You would not use the image of an arrow if you used annotation: it would draw the lines as necessary, and it would move all the lines when you set new X and Y properties for it.
Are you familiar with using get() and set() to manipulate the properties of graphics objects?
Do you specifically wish to use the image of an arrow instead of having MATLAB draw the arrow?
Óscar
Óscar el 20 de Oct. de 2014
How can I use my own arrow, instead of the default? actually I don't want an arrow i'd like something like this:
thanks

Iniciar sesión para comentar.

Categorías

Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.

Preguntada:

el 7 de Nov. de 2011

Comentada:

el 20 de Oct. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by