Matlab App Erroneously detecting infinite loop
6 views (last 30 days)
I have a matlab application that acts as a wrapper to Simulink Test. Some of the Tests can take a very long time to run, I'm talking several hours. When I run one of these tests that involves many iterations the application closes down during the activity. As the data for simulink test is actually loaded on to the Tree I use to display the tests this means that the next Test fails. The weird thing is I can run hundreds of single iteration tests without issue and the issue does not have anything to do with a license I think as I selected to borrow a license for the whole day just in case. The app gives me no errors or warnings it just closes itself down on the long running iterations. Any ideas/ tips appreciated.
Eric Delgado on 30 Sep 2022
Edited: Eric Delgado on 30 Sep 2022
It sounds like a limitation of the foor loops. For example, if you create e for loop from 1 to a BigNumberAlmostInfinite you will receive the warning "Too many FOR loop iterations. Stopping after 9223372036854775806 iterations."
Just replace it for while loops.
% Instead of:
for ii = 1:BigNumberAlmostInfinite
ii = 0;
ii = ii+1;
if ii == BigNumberAlmostInfinite