Divert system command output from command line to textbox in GUI

Hello, I'm designing a GUI involving callings to external functions (.exe) (e.g. system('doThis.exe') ) Those functions produce a lot of output to the MatLab command line and I'd like to simply divert them to/reproduce them in a textbox in my GUI. Is there a simple way to do this? I am using GUIDE but my textbox is created programmaticaly.
Thanks in advance.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 4월 29일

0 개 추천

If you do not need to have it happen as the output is produced, then assign the output of system() to a variable and display that variable. The variable will not be available until the command finishes.

댓글 수: 3

Thanks. I've just tried. it works but the results are not what I expected. The output is simply '0', not the useful output text I see in the command line as the external function is running... and is there a way to reproduce the text on the fly?
[status, cmdout] = system('doThis.exe');
then cmdout is the string.
Capturing the output on-the-fly is messy. I think it was discussed about 3 weeks ago, but I do not seem to find the discussion.
Thank you again, that worked fine :) I think I'll forget the on-the-fly reproduction for now at least.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

질문:

2013년 4월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by