Restart external solver from Matlab script

Hello, I am starting external solver from Matlab script using the following command. Sometimes the external solver fails to start and shows error message. I have written if-else statement for restarting external solver. Duration of normal run is about 30 minutes and failed one lasts for about 30 seconds so I thought that I can distinguish between those two and restart it using measuring time. Unfortunatelly, until on the screen is the error message and no one pushes OK button, it does not continue. So until I find there is the error message it can take much more than 30 seconds so entire run is failed then.
clc
close all
clear all
tic
! "C:\Program Files\external_solver.exe" -i file1.dat -o file1.out;
et = toc
if et < 300;
! "C:\Program Files\external_solver.exe" -i file1.dat -o file1.out
end
;
I would like to ask you for help how to deal with restarting the external solver without manual input (clicking on the error message) in case it failes and show the error message.
Best regards Michal

댓글 수: 1

M Teaxdriv
M Teaxdriv 2022년 7월 12일
Hello,
I got an idea and I would like to ask you for help with it.
I would like to measure time from start of external solver and in case it lasts longer than 3600 sec to start it again.
Do you know how realize it?
BR
Michal

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

답변 (0개)

카테고리

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

제품

릴리스

R2020b

질문:

2022년 7월 11일

편집:

2022년 7월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by