필터 지우기
필터 지우기

How to wait for external exe program output in matlab ??

조회 수: 3 (최근 30일)
Abhimanyu  Kashyap
Abhimanyu Kashyap 2013년 5월 14일
댓글: Walter Roberson 2017년 6월 29일
I am running NASTRAN from MATLAB.. My problem is that I want to run NASTRAN iteratively. For that I need to read NASTRAN output dat and f06 files over and again. But MATLAB goes on running continuously without waiting for the NASTRAN process to complete. So that gives error message. I want to stop MATLAB code until NASTRAN completes its work and gives the output files which I want to read from MATLAB in the next lines of codes..It has to wait until those files are generated. This runs in a loop.. I want to do this so many times. So I dont want to do it manually. Please help me.

채택된 답변

Walter Roberson
Walter Roberson 2013년 5월 14일
If the NASTRAN program creates a graphics window, then it gets messy to do this.
If the NASTRAN program only uses console output, then on the system() or dos() command that you use to invoke the executable, do not have a '&' in the command line.
For example,
disp(1)
system('dir')
disp(2)
the disp(2) will not execute until "dir" has finished and returned.
  댓글 수: 2
Jan Oltmann
Jan Oltmann 2017년 6월 29일
Hi,
I have the same problem. Unfortunately, your answer could not help me, because on my computer matlab never waits. I have a colleague, which computed the same matlab code and Matlab waited for the external program. Does anyone know how to solve this problem?
Walter Roberson
Walter Roberson 2017년 6월 29일
If you take the same command to a Terminal window and run it there, does it wait for you?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by