以下の内容はhttps://seinzumtode.hatenadiary.jp/entry/2020/05/11/102735より取得しました。


Matlabでリアルタイムデータをプロットする(グラフをオートスクロール)

コード

clear; close all;

xs = [];
ts = [];
t=0;
dt = 0.1;
maxn = 50;
while(1)
 ts = horzcat(ts,t);
 x = sin(t); 
 xs = horzcat(xs,x);
 if(length(xs)>maxn)
     ts = ts(2:end);
     xs = xs(2:end); 
 end
 t = t+dt;
 plot(ts,xs);
 xlim([ts(1),ts(1)+dt*maxn]);
 ylim([-1,1]);
 drawnow;
 pause(dt);

end

f:id:seinzumtode:20200511102715g:plain




以上の内容はhttps://seinzumtode.hatenadiary.jp/entry/2020/05/11/102735より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14