Running DOS command from Matlab
9 次查看(过去 30 天)
显示 更早的评论
I am running an execution file of a Fortran code in Matlab using DOS command.(I do not have access to the source code though).
The Fortran code is written in a way that print too many parameters on the screen window. Thus, when you run it on Matlab, all these parameters are printed on command window therefore it extremely reduces the SPEED.
Since I do not have any access to the source code, I cannot avoid the fortran code of doing that, but is there any way, not allowing the matlab to print these useless parameters on the command window.
Thanks
0 个评论
采纳的回答
Jason Ross
2011-9-13
You can redirect the output to a file if you do care about reviewing it later:
system('mycommand > myoutputfile.txt')
or you can just send the output to null
system('mycommand > NUL')
or output and errors if you really don't care at all.
system('mycommand 1 > NUL 2 > NUL')
更多回答(1 个)
sam Pournazeri
2011-9-13
1 个评论
Jason Ross
2011-9-13
A theory -- there might be some difference in environment variables between the system command and your "bare" command prompt. Run
system('set')
in MATLAB and also run 'set' at the command prompt, and see if there is something different that might affect the performance of your code. You can try using setenv() to change the command environment before you call system().
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fortran with MATLAB 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!