フィルターのクリア

how to plot animated 2D figure using time axis and function in gui matlab ?

2 ビュー (過去 30 日間)
Mostafa Salah
Mostafa Salah 2020 年 4 月 15 日
コメント済み: Geoff Hayes 2020 年 4 月 16 日
I'm trying to plot animated plot using many functions like addpoints but it doesnot work in guide .how can i solve this problem and plot 2d graph using function and time axis.
  5 件のコメント
Geoff Hayes
Geoff Hayes 2020 年 4 月 16 日
But animate how? Using animatedline?
Mostafa Salah
Mostafa Salah 2020 年 4 月 16 日
Anything, i just need to animation figure in gui like wave moving

サインインしてコメントする。

採用された回答

Geoff Hayes
Geoff Hayes 2020 年 4 月 16 日
Mostafa - perhaps the following can be adapted for your needs
x = linspace(-2*pi,2*pi,1000);
y = sin(x);
figure;
hPlot = plot(NaN,NaN);
xlim([min(x) max(x)]);
ylim([min(y) max(y)]);
for k = 1:length(x)
set(hPlot, 'XData', [get(hPlot,'XData') x(k)], 'YData', [get(hPlot,'YData') y(k)]);
pause(0.001);
end
  2 件のコメント
Mostafa Salah
Mostafa Salah 2020 年 4 月 16 日
This for gui?
Geoff Hayes
Geoff Hayes 2020 年 4 月 16 日
It can be...so long as your GUI has an axes you can make sure the plot, xlim, and ylim functions are set fot that axes.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by