hello everyone, i have this urgent problem
1 回表示 (過去 30 日間)
古いコメントを表示
hello everyone, i have a problem about animating multi-sin waves,each of them is starts with different time(ex:sin1 starts with 0,sin2 starts with 1...etc),besides,the animation speed of them r different,can someone help me out,please? i really need to figure this out for my thesis ><
3 件のコメント
Walter Roberson
2020 年 7 月 6 日
N = 1000;
t2 = linspace(0, 100, N);
t = t/5;
Do not use t = linspace(0,100) and then t2=t1*5 because if you do then t2 will escape the boundaries of the plot.
採用された回答
Walter Roberson
2020 年 7 月 6 日
編集済み: Walter Roberson
2020 年 7 月 6 日
I discus one of the techniques in https://www.mathworks.com/matlabcentral/answers/496730-how-to-start-and-stop-parallel-timer-delays-on-off-delays-in-matlab#answer_406682
The other main possibility is to use timers, one for each simulation, with the timers firing each time each simulation is to advance to the next sample.
0 件のコメント
その他の回答 (1 件)
Steven Lord
2020 年 7 月 6 日
t = 0:360;
h1 = animatedline('LineStyle', '-', 'Color', 'k');
h2 = animatedline('LineStyle', '--', 'Color', 'c');
axis([0 450 -1 1]);
for k = 1:numel(t)
addpoints(h1, t(k), sind(t(k)));
addpoints(h2, t(k)+90, sind(t(k)));
pause((10/360))
end
While in this example I called addpoints on each of the animatedline objects at each iteration of the for loop, you could update each line only at certain iterations if you so desired.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!