2つの画像を待機時間毎に繰り返し出力すると画像がちらつきます。対策を教えてください。
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
2つの画像を待機時間毎に繰り返し出力すると画像がちらつきます。 1つの画像出力では問題ないですが、2つの画像出力ではちらつきます。 以下にサンプルコードを示します。 プログラム実行後、figure(1)とfigure(2)をドラッグ&ドロップで離してください。
T = timer('TimerFcn',@(~,~)disp('Fired.'),'StartDelay',0.5);
for i=1:1:30
figure(1)
z=ones(100);
image(z)
figure(2)
z=ones(100);
image(z)
start(T)
wait(T)
end
使用しているPCは、windows7、プロセッサ:xeon(r) CPU E5-2609 0,メモリ:64GB
以上、よろしくお願いします。
0 Commenti
Risposta accettata
Tohru Kikawada
il 30 Gen 2017
"ちらつき"は figure がそれぞれアクティブになり、前面に移動するため発生していると思います。
figure 自体は操作せずに、直接 image のハンドラーを経由して値を変更することができます。
下記のコードをお試しください。
T = timer('TimerFcn',@(~,~)disp('Fired.'),'StartDelay',0.5);
figure(1);
z=rand(100,100,3);
h1 = image(z);
figure(2);
z=rand(100,100,3);
h2 = image(z);
for i=1:1:30
z1 = rand(100,100,3);
h1.CData = z1;
z2 = rand(100,100,3);
h2.CData = z2;
start(T)
wait(T)
end
このようなオブジェクトのプロパティへのアクセスは下記のヘルプが参考になります。 https://www.mathworks.com/help/matlab/creating_plots/access-and-modify-property-values.html
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Downloads in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!