System Command Output not Appearing in Command Window

10 次查看(过去 30 天)
Hi all,
I've been battling with the system command recently and am absolutely stumped. I am running on Mac OS X 10.7, MATLAB 2012a (7.14) and in the bash shell. I have an external script that I can successfully run from MATLAB, but the intermediate output from this script is not echoed back to the command window. I have tried system('MyCommand','-echo') with no success. When I run it in Terminal, I get all kinds of intermediate info, such as convergence criterion, residuals, etc., but this is not the case when I run the script via MATLAB.
I'm absolutely stumped and have no idea why the '-echo' flag isn't working. Any thoughts?
Thanks!
  8 个评论
Walter Roberson
Walter Roberson 2013-3-4
If you run the fortran program outside of MATLAB do the final values appear?
Parker
Parker 2013-3-4
编辑:Parker 2013-3-4
Yes. But to be fair, it is flushing output line by line, so there couldn't have been any surprises there.
In any case, the point is everything was fine with previous Matlab releases...
Also, the "workaround" to flush each line independently as I presented previously is actually quite a bad idea, as it significantly slows down execution time if you also write things in text files.
It is far better to use
setenv('GFORTRAN_UNBUFFERED_PRECONNECTED','1')
But this is still only a workaround.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by