MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何在Matlab或Octave中刷新disp的输出? (https://www.labfans.com/bbs/showthread.php?t=23310)

poster 2019-12-10 20:30

如何在Matlab或Octave中刷新disp的输出?
 
我在Octave中有一个带循环的程序-运行具有各种参数的函数,而不是可以转换为矩阵的函数。在每次迭代的开始,我使用disp打印当前参数。

第一次运行它时,我发出了[URL="http://politicalhumor.about.com/library/jokes/bljokebushbrazilian.htm"]惊人的[/URL]警告,然后我也得到了这些印刷品。现在,我清理了它们,再也看不到它们了。我的猜测是它们卡在缓冲区中,程序结束或缓冲区满时我会看到它们。

有什么方法可以强制清空打印缓冲区,以便我可以看到自己的打印件吗?



[B]回答:[/B]

使用fflush(stdout)和/或fflush(stderr)从disp()刷新缓冲区。



[url=https://stackoverflow.com/questions/2633019]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 16:15

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.