How can I plot a continuously changing value from a slider?

For a simple equation such as y=x^2, the variable x will be the value obtained from the slider. Upon pressing a push button to generate a simple plot, as the user is sliding the value on the slider, how can this changing value be updating in the already formed plot?

回答 (1 件)

Mandar Patwardhan
Mandar Patwardhan 2017 年 6 月 27 日

0 投票

Use the following documentation as a reference to build a plot with a slider. Drag the slider to see the change in the plot. This particular example uses callbacks to achieve the change in the existing plot.

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

2017 年 6 月 22 日

回答済み:

2017 年 6 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by