How to create interactive plot in matlab

406 ビュー (過去 30 日間)
khu 2016 年 5 月 21 日
コメント済み: Eric Sargent 2020 年 5 月 21 日
Hello Everyone,
I am looking to design an interactive plot for a function f(x,y). I would like to add a slider for x and y that would change the plot in realtime. I am also open to do this using GUI. Let me know what might be the better approach to this problem. Plot should be f vs x or f vs y.

回答 (2 件)

Geoff Hayes
Geoff Hayes 2016 年 5 月 22 日
khush - I think the best approach is to use GUIDE to create your GUI with an axes and two slider (one for each of x and y). The callback for the slider could then be used to update the function as drawn on your axes. See to get you started on creating your GUI.
  1 件のコメント
Eric Sargent
Eric Sargent 2020 年 5 月 21 日
The GUIDE design environment will be removed in a future release of MATLAB, I recommend using App Designer instead.


Eric Sargent
Eric Sargent 2020 年 5 月 21 日
App Designer is the recommended enviroment for building apps in MATLAB. To get started, you can watch this video:


Find more on Migrate GUIDE Apps in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by