So i have written some code which used a console command to do a calculation
The issue is that this console command doesnt work everytime. Running the same thing multiple times does produce different results(the console calculation, not the matlab code itself)
command = sprintf('simpson RRfiles/RR%g.in', k);
status = system(command);
Here is the trouble section of my code.
What simpson does is it takes in a set of values contained in the RR(X).in files and outputs a RR(X).fid file.
An example of a working .fid file is
And an example of a failed one is
What i need help with is writing a for loop that comes after this one that goes in the directory where i store the .fid files (something like c:\matlab\codelocation\fidfilelocation) and checks them all to see if they have worked on not, and if they havnt then it runs the console command again and then checks again afterwards, repeating this cycle till all of them have worked.
I know it is weird that the code doesnt work the same everytime. My current solution is to simply '!simpson RR(X).in' and check if it worked and repeat untill it does.