Is there a way to make Matlab stop a script if it's taking to long?

7 views (last 30 days)
I'm using XFOIL and periodically it won't converge after a certain number of iterations. After the nth iteration instead of stopping it stays hung up in XFOIL. From experience, I know the data at that is point useless and I'd like to proceed onto the next data set. To do this I need to restart MATLAB and restart the code. If I could say "after 2 minutes no data has been returned move onto the next data point" it would be extremely useful.

Answers (1)

Walter Roberson
Walter Roberson on 31 Mar 2018
The only way to do this in MATLAB is to use batch() or parfeval() to execute the code, and if you do not have an answer by the time you want, then to cancel() the parallel future.

Categories

Find more on Text Analytics Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!