Plotting Stem Plots with animatedline

4 次查看(过去 30 天)
Jay P.
Jay P. 2022-10-14
回答: KSSV 2022-10-14
I can use animatedline to plot linear graphs. Fine. But how do I use animatedline to plot stem plots?

回答(1 个)

KSSV
KSSV 2022-10-14
x = linspace(0,4*pi,1000);
y = sin(x);
for i = 1:length(x)
stem(x(1:i),y(1:i))
axis([min(x) max(x) min(y) max(y)])
drawnow
end

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by