91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

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

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

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

鲁山县| 大庆市| 白银市| 安福县| 根河市| 九台市| 永顺县| 敦化市| 海南省| 资阳市| 天津市| 衢州市| 封开县| 祁连县| 岐山县| 宕昌县| 勐海县| 平邑县| 阳谷县| 南昌县| 平原县| 盖州市| 红桥区| 尉犁县| 龙游县| 长宁区| 怀柔区| 梁平县| 金山区| 宾阳县| 临泽县| 灌云县| 布拖县| 蒙城县| 正安县| 勃利县| 胶州市| 中西区| 宣城市| 邵东县| 榆林市|