Is is possible to redirect the output of a system command that calls another program?
6 ビュー (過去 30 日間)
古いコメントを表示
Essentially, I am calling the system command to run Vivado Lab in order to program an FPGA over JTAG. So
status = system('vivado_lab prog.tcl')
is the command I run. The output of this writes to the Command Window of uncompiled code and to the Console of compiled code. Part of this output is a progress bar. Is it possible to make this output to a text area, a different function, or somehow get the output while the command is still running?
0 件のコメント
採用された回答
Walter Roberson
2025 年 2 月 10 日
HDL Coder does not appear to be supported on Mac.
On Linux:
Redirect output (possibly stderr) to a named pipe. Read from the named pipe within MATLAB.
On Windows:
Instead of using system(), use the .NET facility System.Diagnostics.Process . See for example https://www.mathworks.com/matlabcentral/answers/2002092-system-diagnostics-process-doesn-t-execute-all-commands-in-external-file#answer_1280947 but you would RedirectStandardOutput instead of RedirectStandardInput (or possibly RedirectStandardError). You would stdout.ReadLine to get at the output line by line.
2 件のコメント
Walter Roberson
2025 年 2 月 10 日
Well, if you are somehow running Vivado on your Mac (perhaps you have Parallels installed to run other binaries through emulation, as Vivado binaries for Mac are not available), then you can use the named pipe approach on your Mac.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!