'addpoints' animation with a control slider

조회 수: 7 (최근 30일)
feynman feynman
feynman feynman 2022년 12월 3일
댓글: feynman feynman 2024년 2월 15일
Somehow making an animation with 'addpoints' enables a control slider for the user to slide back and forth to view the animation, but sometimes the slider disappears. Which syntax ensures that it appear?
  댓글 수: 10
Adam Danz
Adam Danz 2024년 2월 13일
I'm not aware of a slider that automatically appears after running the code you shared.
If this is run in an app or live script, a uislider could be added, though.
feynman feynman
feynman feynman 2024년 2월 15일
Yes, in a live script! My newest concern is how to stop an animation loop perhaps through a uicontrol in a live script?
https://www.mathworks.com/matlabcentral/answers/2079766-how-to-stop-loops-or-close-figures-in-live-scripts?s_tid=srchtitle

댓글을 달려면 로그인하십시오.

답변 (1개)

Vidip Jain
Vidip Jain 2023년 3월 20일
The slider you are referring to is called a "data cursor" in MATLAB. By default, it appears when you create a plot with a line object, and you hover over the line with your mouse cursor. However, it may not always appear when using “addpoints” to animate a plot.
To ensure that the data cursor appears, you can use the “datacursormode” function in MATLAB. This function allows you to enable or disable the data cursor mode for a specific plot or all plots in a figure.
You can also customize the appearance and behavior of the data cursor using various options available in the “datacursormode” function.
  댓글 수: 1
feynman feynman
feynman feynman 2023년 4월 27일
thanks a lot. "it may not always appear when using “addpoints” to animate a plot." Does the appearance depends on luck? How can this be a random event?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by