中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Matlab Timer回調函數的執行中rawnow函數的用途是什么

發布時間:2021-10-14 10:07:24 來源:億速云 閱讀:157 作者:柒染 欄目:編程語言

本篇文章為大家展示了Matlab Timer回調函數的執行中rawnow函數的用途是什么 ,內容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。

    由前一篇文章可以看出,按照所設定的時間間隔調用Timer的回調函數時,并不是真的即刻執行該回調函數,而是先將該回調函數放入事件隊列中,待前面的事件都執行完時才執行該事件。但有時我們需要當所設定的時間到達時立刻執行我們的回調函數,此時我們就可以用功能強大的drawnow函數了。在回調函數中加入drawnow就可以在時間到達時強制執行該回調函數。

下面給出的是matlab幫助里關于drawnow的用法:

drawnow

Flush event queue and update figure window
Syntax

drawnow
drawnow expose
drawnow update
Description

drawnow causes figure windows and their children to update and flushes the system event queue. Any callbacks generated by incoming events (e.g. mouse or key events) are dispatched before drawnow returns.

drawnow expose causes only graphics objects to refresh, if needed. It does not allow callbacks to execute and does not process other events in the queue.

drawnow update causes only non-graphics objects to refresh, if needed. It does not allow callbacks to execute and does not process other events in the queue.

You can combine the expose and update options to obtain both effects.

drawnow expose update

Other Events That Cause Event Queue Processing

Other events that cause MATLAB to flush the event queue and draw the figure includes:

    *

      Returning to the MATLAB prompt
    *

      Executing the following functions
          o

            figure
          o

            getframe
          o

            input
          o

            keyboard
          o

            pause
    *

      Functions that wait for user input (i.e., waitforbuttonpress, waitfor, ginput)
    *

      Any code that causes one of the above functions to be executed. For example, suppose h is the handle of an axes. Calling axes(h) causes its parent figure to be made the current figure and brought to the front of all displayed figures, which results in the event queue being flushed.

Examples

Using drawnow in a loop causes the display to update while the loop executes:

t = 0:pi/20:2*pi;
y = exp(sin(t));
h = plot(t,y,'YDataSource','y');
for k = 1:.1:10
 y = exp(sin(t.*k));
 refreshdata(h,'caller') % Evaluate y in the function workspace
 drawnow; pause(.1)
end

上述內容就是Matlab Timer回調函數的執行中rawnow函數的用途是什么 ,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

时尚| 湾仔区| 湘西| 宜兴市| 清水河县| 成安县| 旬阳县| 遂溪县| 开化县| 旬邑县| 铁力市| 拉萨市| 星座| 常熟市| 丰城市| 临沧市| 偏关县| 封开县| 丘北县| 麻栗坡县| 两当县| 连南| 宜川县| 丰原市| 吐鲁番市| 武强县| 扎兰屯市| 永吉县| 阿合奇县| 碌曲县| 桐城市| 大兴区| 合阳县| 怀远县| 南开区| 新宁县| 龙江县| 黔江区| 元氏县| 汶川县| 营口市|