フィルターのクリア

Can I make addpoints function show me more than one curve in ONE figure ?

8 ビュー (過去 30 日間)
omar th
omar th 2022 年 8 月 24 日
コメント済み: omar th 2022 年 8 月 25 日
and got the answer from @ Walter Roberson, but now I modified the question as in the code below,,Can I use the addpoints function to show me
x1(i), x2(i), x3(i), and x4(i)
in ONE figure BUT seperated (Splitted curves in one figure) ?
Thanks in advance
while 1
for i=1:20
x1(i)=something
x2(i)=something
x3(i)=something
x4(i)=something
end
plot(x,i)
end

採用された回答

Steven Lord
Steven Lord 2022 年 8 月 24 日
So you want multiple animated lines in the same figure? That's easy, just use multiple animatedline objects.
x = 0:360;
axis([0 360 -1 1]);
hold on
s = animatedline('Color', 'r', 'DisplayName', 'sine');
c = animatedline('Color', 'c', 'DisplayName', 'cosine');
legend show
for k = 1:numel(x)
addpoints(s, x(k), sind(x(k)));
addpoints(c, x(k), cosd(x(k)));
pause(0.01)
end
  1 件のコメント
omar th
omar th 2022 年 8 月 25 日
Thank you so much, its just ancrease the number of animated lines and addpoints functions seperatedly. Its worked thanks again

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by