本文介绍了MATLAB做苛刻的计算时推迟DISP电话。这是为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现在MATLAB算法。在其他方面,它计算的最短路径等,所以它是相当苛刻的我的旧电脑。我已经把 DISP()调用通过了该方案,看看发生了什么所有的时间。

I am implementing an algorithm in MATLAB. Among other things it calculates the shortest paths etc. so it's quite demanding for my old computer. I've put in disp() calls through out the program to see what's happening all the time.

然而在格外沉重循环启动 DISP()的时候 seemes不要被所谓直到循环结束,尽管它涉及循环之前。这是为什么?我认为,MATLAB是真的顺序执行的还是我只是噎它有太多的计算和 DISP()调用get优先级最低的?

However when starting on a particulary heavy for loop the disp() seemes not to be called until the loop is over even though it comes before the loop. Why is that? I thought that MATLAB was really executing sequentially or am I just choking it with too many calculations and the disp() calls get the lowest priority?

推荐答案

我几乎可以肯定这是因为EDT的。

I am almost certain it is because of EDT.

这就是功能的DrawNow()是。请参见的亚伊尔奥特曼获得很好的解释文章。

That's the function drawnow() is for. See article of Yair Altman for good explanation.

摘要:MATLAB图形就是Java Swing和操作发生在一个特殊的线程 - 事件指派线程(EDT)。呼叫的DrawNow(); 刷新事件队列和更新的身影窗口

Summary: MATLAB graphics is Java Swing and operations happen on a special thread - Event Dispatch Thread (EDT). Calling drawnow(); flushes event queue and updates figure window.

这篇关于MATLAB做苛刻的计算时推迟DISP电话。这是为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 19:46