System Command Output not Appearing in Command Window

7 ビュー (過去 30 日間)
Aero Guy
Aero Guy 2012 年 7 月 16 日
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 Center および File ExchangePlatform and License についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by