I've written a configuration selection code based on genetic algorithm. Now when i'm running it on different platforms like 2015a and 2016a it gives different answers. In my code I've repeated the algorithm 100 times so that no discrepancy occurs.

The code is giving different answers when executed in different MATLAB versions, i.e., 2015a and 2016a. I think the problem is occurring due to the rand function which has been used in it, but I'm not sure.

7 commentaires

If you use rand() you should expect the results are different. So why do you assume something else?
Basically, my code returns 3 parameters which are the optimal parameters for a converter. Now, I've based my code on the genetic algorithm. In order to avoid discrepancies, I run the code for 100 iterations and the most common answer over the 100 iterations is selected as the answer. Now, when I'm executing the code on different MATLAB versions the answer is varying. I can't explain what's happening in this case.
What does this mean: "In order to avoid discrepancies, I run the code for 100 iterations"? Discrepancies between what?
Without seeing the code, there is no chance to find out, which part might be influenced by different Matlab versions. Do the reply change for different runs on the same machine and Matlab version?
Actually discrepancies between answers which the code returns. Since the code is based on the genetic algorithm every time it would return a different answer. Thus so as to avoid this, I looped the entire thing for a 100 times and the answer most common in the 100 times is then finally selected.
I still do not see the chance to post an answer. Please explain any details.
Nobody can answer a question where only a vague (and confusing) set of comments are made about what you did. If you seriously want help, then you need to show exactly what you are doing. You need to explain clearly what you perceive to be the problem.

Connectez-vous pour commenter.

Réponses (0)

Produits

Modifié(e) :

Jan
le 2 Mar 2018

Community Treasure Hunt

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

Start Hunting!

Translated by