Found something very interesting with the profiler. In the file “Find_Best_Combination.m”, line 56, there is the code:
Possible_Combinations(Temp_Index,:) = [];
Line 56: Possible_Combinations(Temp_Index,:) = []; 220223 Calls, 7.095 s
So basically it takes for ever to delete a record that is in the middle of a set of data. Maybe instead of deleting a record, I should move correct ones to a new array, and then delete the first record. I have heard that deleting records either at the start or the end is quicker.
The only other sources of delay are the “Generate_Possible_Combinations.m” and “Check_Order.m” routines. This is purely due to the fact that they are called so many times. I think they are fairly well optimised already.
What i could try is to remove the redundant order check part of the code and let the “SolvePosition.m” routine take all the working…
Ok forget about that! I just did the above, and not only did it take 140 seconds, there was a 95% error. Probably something wrong with the error, but I’m not about to check when it took that long. It should take something around 20 seconds.
Thats about it for today, so I am waiting a reply from kevin about his thoughts on the accuracy of the “SolvePosition.m” routine, but I’m just about done. So…
Todo:
- I think I should check where these errors are actually happening to make sure that I can’t do anything about it.
- Then after that I should finish the whole thing and present a graph of the found drops and data. Then thats about it!
- Then onto the c++. I think I have decided c++ because it will give me a better stead in the long run. Companies are really looking for c++ rather than c#, but c# is only a simple step away. I could probably learn c# in my spare time if I have a good c++ background.