Removing Duplicate Elements from Array sets
714 次查看(过去 30 天)
显示 更早的评论
I am constructing a genetic algorithm for finding optimal solution of a problem. The population used consists of three controller parameters (Kp Ki Kd)and fitness value. If the values of [Kp Ki Kd] are repeated the chances of finding a wrong solution due to premature conversion is high. So i want to check if there are any duplicate entries for [Kp Ki Kd] and remove them.
NOTE: I only want to remove if all the three [Kp Ki Kd] are same.
0 个评论
采纳的回答
更多回答(1 个)
David Sanchez
2013-5-13
Use unique command:
M = [1 2 3; 4 5 6;1 2 3; 1 2 3; 6 7 8];
A = unique(M,'rows')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!