フィルターのクリア

animatedline function in under R2014b version

3 ビュー (過去 30 日間)
tiff
tiff 2015 年 12 月 19 日
回答済み: Walter Roberson 2015 年 12 月 19 日
Hi, I am using matlab 2014a, i want to use animatedline function but it is introduced in matlab 2014b. What's function i can use in R2014a to do the same task?

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 19 日
Example:
xlist = [];
ylist = [];
myline = line('LineStyle', '-', 'Marker', '*', 'Color', 'b'); %use appropriate properties
set(gca, 'xlim', [0 1000], 'YLim', [-10 35]);
for K = 1 : 1000
newx = K + randn();
newy = sqrt(newx) + sin(newx);
xlist = [xlist, newx];
ylist = [ylist, newy];
if length(xlist) > 20
xlist = xlist(end-19:end);
ylist = ylist(end-19:end);
end
set(myline, 'XData', xlist, 'YData', ylist);
drawnow();
end
Note: although it is tempting to call line() or plot() with x and y data being empty to set up the line with no contents, doing so will result in no line, and then R2014a will not notice it is working with an empty graphics object.

その他の回答 (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