亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

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

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

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

唐河县| 晋中市| 宜阳县| 阳新县| 札达县| 东乌| 登封市| 通山县| 太白县| 宜兰市| 观塘区| 永平县| 黑龙江省| 黄大仙区| 五大连池市| 汶川县| 板桥市| 饶河县| 平邑县| 鹤山市| 德令哈市| 吴江市| 建阳市| 盐源县| 扎囊县| 阳东县| 遂平县| 枣庄市| 南安市| 玉环县| 广宗县| 桦川县| 克拉玛依市| 邢台市| 花莲县| 宁陕县| 西和县| 湘潭市| 香河县| 大方县| 乌鲁木齐县|