GUI dynamic interface
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2011년 11월 7일
Closely related question by the same author: http://www.mathworks.com/matlabcentral/answers/20564-gui-dynamic-output
답변 (1개)
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 X and Y properties of the annotation arrow to be the new desired start and end positions.
댓글 수: 3
Walter Roberson
2011년 11월 7일
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
2014년 10월 20일
How can I use my own arrow, instead of the default? actually I don't want an arrow i'd like something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/178913/image.png)
thanks
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!